Message from JavaScript discussions

January 2019

— But what i want to do is basically make the axios wrapped with config i made

— 

For more context, this is what my requestHandler do:

export function requestHandler (config) {
// Get token from function getToken
let token = getToken()
// Check token not null value
if (token) {
config.headers.authorization = `JWT ${token}`
}
return config
}

— Alright, how is Vue available in main.js and not store/modules

— Am using vue cli 3 so it come with

new Vue({
router,
store,
render: h => h(App)
}).$mount('#app')

— 🤔

— You should still be avilable to import Vue from 'vue' since thats what you are doing in main.js righT ?

Message permanent page

— Yes i can do that

— But then i got this

— Is it vue which is undefined or $HTTP

— The $HTTP

— Maybe that method isnt in the prototype, the $HTTP could be located directly on the Vue instance

— But i already define Vue.prototype.$HTTP = HTTP 🤔