2019-04-11 00:12:23 +02:00
|
|
|
import axios from 'axios'
|
|
|
|
|
|
|
|
// https://github.com/alvar0hurtad0/drupal-vuejs-todo/blob/master/frontend/src/api/axiosInterceptor.js
|
|
|
|
|
2021-03-31 18:42:05 +02:00
|
|
|
// console.log('drupalSettings', drupalSettings)
|
|
|
|
console.log(window.location)
|
2019-04-11 00:12:23 +02:00
|
|
|
|
|
|
|
export const JSONAPI = axios.create({
|
2019-05-21 15:54:27 +02:00
|
|
|
baseURL: window.location.origin+`/jsonapi`,
|
2019-05-21 16:42:36 +02:00
|
|
|
withCredentials: true,
|
2019-04-11 00:12:23 +02:00
|
|
|
headers: {
|
|
|
|
Accept: 'application/vnd.api+json'
|
2019-05-21 16:42:36 +02:00
|
|
|
// Authorization: 'Basic {token}',
|
2021-03-31 18:42:05 +02:00
|
|
|
// 'Content-Type': 'application/json'
|
2019-04-11 00:12:23 +02:00
|
|
|
}
|
|
|
|
})
|