2019-04-09 00:21:00 +02:00
|
|
|
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
|
|
|
|
|
2021-03-31 18:42:05 +02:00
|
|
|
// console.log('drupalSettings', drupalSettings)
|
2021-03-31 19:17:55 +02:00
|
|
|
// console.log('window.location.origin', window.location.origin)
|
2019-04-09 00:21:00 +02:00
|
|
|
|
2019-04-11 00:12:23 +02:00
|
|
|
export const REST = axios.create({
|
2021-03-31 22:00:37 +02:00
|
|
|
baseURL: window.location.origin + '/' + drupalSettings.path.pathPrefix,
|
2019-05-21 16:42:36 +02:00
|
|
|
withCredentials: true,
|
2019-04-09 00:21:00 +02:00
|
|
|
headers: {
|
2019-05-21 17:00:14 +02:00
|
|
|
// Authorization: 'Bearer {token}',
|
2021-03-31 18:42:05 +02:00
|
|
|
'Content-Type': 'application/json'
|
2019-04-09 00:21:00 +02:00
|
|
|
}
|
|
|
|
})
|