materio-d9/web/themes/custom/materiotheme/vuejs/api/rest-axios.js

16 lines
479 B
JavaScript
Raw Normal View History

import axios from 'axios'
2019-04-10 10:47:45 +02:00
// https://github.com/alvar0hurtad0/drupal-vuejs-todo/blob/master/frontend/src/api/axiosInterceptor.js
// console.log('drupalSettings', drupalSettings)
// console.log('window.location.origin', window.location.origin)
export const REST = axios.create({
baseURL: window.location.origin + '/' + drupalSettings.path.pathPrefix,
2019-05-21 16:42:36 +02:00
withCredentials: true,
headers: {
// Authorization: 'Bearer {token}',
'Content-Type': 'application/json'
}
})