Skip to content

Router

StarterStack uses the standard Vue-Router to handle Single Page Application (SPA) routes. The routes are located in /frontend/router/index.js.

Adding Routes

Follow the standard Vue-Router docs for instructions on how to add new routes.

Protecting Routes

If you need to prevent certain routes from being accessed without being logged in, add requiresAuth: true to the route meta object.

For example:

JS
{
    path: '/my-new-route/:id',
    name: 'my-route',
    component: () => import('../views/MyNewViewView.vue'),
    meta: { requiresAuth: true } // <-- this makes the route accessible if logged in
}