The router option is used to overwrite the default Nuxt configuration on the Vue router. The default Vue router configuration is as follows:
{
mode: 'history',
base: '/',
routes: [],
routeNameSplitter: '-',
middleware: [],
linkActiveClass: 'nuxt-link-active',
linkExactActiveClass: 'nuxt-link-exact-active',
linkPrefetchedClass: false,
extendRoutes: null,
scrollBehavior: null,
parseQuery: false,
stringifyQuery: false,
fallback: false,
prefetchLinks: true
}
You can change this configuration, as follows:
// nuxt.config.js
export default {
router: {
base: '/app/'
}
}
Now, your app is running at localhost:3000/app/.
For more information about this property and the rest of its configuration, visit https://nuxtjs.org/api/configuration-router.
You can find an example app for this option in /chapter-2/configuration/router/ in our GitHub repository.
You can find an example app for this option in /chapter-2/configuration/router/ in our GitHub repository.