skyrpex / laravel-nuxt-js

Build a SPA with Laravel and Nuxt.
https://www.npmjs.com/package/laravel-nuxt
MIT License
146 stars 20 forks source link

[ERROR| Help] Change base route url from nuxt.config.js #33

Open livevasiliy opened 4 years ago

livevasiliy commented 4 years ago

Hello @skyrpex !

I want change base route for nuxt app via configuration field in nuxt.config.js like this:

router: {
  base: '/admin/',
},

But after change this settings I get error 404 _nuxt directory. I want startup my nuxt app with next route: localhost:8000/admin/

andig89 commented 4 years ago

Simple add:

{
    router: {
        extendRoutes(routes, resolve) {
            routes.forEach((route) => {
                route.path = '/admin' + route.path;
            });

            return routes;
        }
    }
}