What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-11-07 10:30:18
axios configure base url
axios.defaults.baseURL = '/api/'; Add solution -
Other 2021-09-30 22:02:02
cache request in vue
import axios from 'axios'; import { cacheAdapterEnhancer } from 'axios-extensions'; const http = axios.create({ baseURL: '/', headers: { 'Cache-Control': 'no-cache' }, // cache will be enabled by default adapter: cacheAdapterEnhancer(axio... Add solution -
Javascript 2021-09-29 22:54:04
axios default baseurl conditional environment
import axios from 'axios' window.axios.defaults.headers.common = {'X-Requested-With': 'XMLHttpRequest'} window.axios.defaults.baseURL = (process.env.NODE_ENV !== 'production') ? 'http://localhost:9000/api/' : '' Add solution -
Javascript 2021-09-08 20:21:02
get an access token for microsoft graph api using javascript
const postData = { client_id: APP_ID, scope: MS_GRAPH_SCOPE, client_secret: APP_SECERET, grant_type: 'client_credentials' }; axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded'; axios .post(TOKEN_ENDPOINT, qs.st... Add solution