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

15 lines
408 B
JavaScript

import axios from 'axios'
// https://github.com/alvar0hurtad0/drupal-vuejs-todo/blob/master/frontend/src/api/axiosInterceptor.js
// console.log('drupalSettings', drupalSettings)
export const MA = axios.create({
baseURL: window.location.origin + '/' + drupalSettings.path.pathPrefix,
withCredentials: true,
headers: {
'Content-Type': 'application/json'
// "X-CSRF-Token": "csrf_token"
}
})