json-axios.js 459 B

12345678910111213141516
  1. import axios from 'axios'
  2. // https://github.com/alvar0hurtad0/drupal-vuejs-todo/blob/master/frontend/src/api/axiosInterceptor.js
  3. // console.log('drupalSettings', drupalSettings)
  4. console.log(window.location)
  5. export const JSONAPI = axios.create({
  6. baseURL: window.location.origin+`/jsonapi`,
  7. withCredentials: true,
  8. headers: {
  9. Accept: 'application/vnd.api+json'
  10. // Authorization: 'Basic {token}',
  11. // 'Content-Type': 'application/json'
  12. }
  13. })