laravel-nuxt-js icon indicating copy to clipboard operation
laravel-nuxt-js copied to clipboard

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

Open livevasiliy opened this issue 6 years ago • 1 comments

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/

livevasiliy avatar Sep 10 '19 20:09 livevasiliy

Simple add:

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

            return routes;
        }
    }
}

andig89 avatar Jan 20 '20 10:01 andig89