Starter of AdonisJs framework with Vue SPA and Auth prebuilt
adonis new myapp —blueprint=IvanAquino/adonis-vuetify-starter
Vue app it’s in the folder vue_app/, you can modify the different components and compile
Watch changes on components
npm run watch
Compile production version
npm run production
Modify myapp/vue_app/router/index.js
let router = new VueRouter({
mode: 'history',
....
And next modify myapp/start/routes.js
// Route.on('/').render('frontend')
// At the end of the file
Route.any('*', ({ view }) => view.render('frontend'))
AdonisJS documentation - Routing for SPAs
adonis serve --dev
You can use this.$http to access all methos of Axios
Use this.$auth.getToken() to access Bearer Token
let headers = { 'Authorization': this.$auth.getToken() }
this.$http.get(`${window.basePath}/auth/user`, {headers})