Skip to content

Latest commit

 

History

History
66 lines (46 loc) · 1.31 KB

README.md

File metadata and controls

66 lines (46 loc) · 1.31 KB

Adonis Vuetify starter with prebuilt auth pages

Features

  • Single Page Application
  • Vue and Vue router configured with Auth restricted pages
  • Two Dashboard page examples
  • Prebuilt auth with JWT
  • UI with Vuetify
  • Powered by AdonisJS

Installation

adonis new myapp --blueprint=IvanAquino/adonis-vuetify-starter

Vue App

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

Vue Router History Mode

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

Run adonis serve dev mode

adonis serve --dev

Http Request

You can use this.$http to access all methos of Axios

Headers on authorized routes

Use this.$auth.getToken() to access Bearer Token

let headers = { 'Authorization': this.$auth.getToken() }

this.$http.get(`${window.basePath}/auth/user`, {headers})