Files
Febe/src/Febe.Web/wwwroot/js/routes.js
T

21 lines
1.3 KiB
JavaScript

// The pages of Febe. Each entry: a pattern on the Italian address, the item of the sidebar it lights up, and the
// module that draws it (loaded on demand). The server answers every address without an extension with index.html,
// so a new page needs only a line here and its module in js/pages/ (see src/Febe.Web/LEGGIMI.md).
export const routes = [
{ pattern: /^\/$/, redirect: '/libreria' },
{ pattern: /^\/libreria\/?$/, nav: 'libreria', page: () => import('./pages/library.js') },
{ pattern: /^\/account\/?$/, nav: 'account', page: () => import('./pages/accounts.js') },
{ pattern: /^\/account\/(?<id>\d+)(?:\/(?<tab>contenuti|impostazioni|cronologia))?\/?$/, nav: 'account', page: () => import('./pages/account.js') },
{ pattern: /^\/attivita\/?$/, nav: 'attivita', page: () => import('./pages/activity.js') },
{ pattern: /^\/importa\/?$/, nav: 'importa', page: () => import('./pages/import.js') },
{ pattern: /^\/doppioni\/?$/, nav: 'attivita', page: () => import('./pages/duplicates.js') },
{ pattern: /^\/impostazioni\/?$/, redirect: '/impostazioni/generali' },
{
pattern: /^\/impostazioni\/(?<section>generali|limiti|collegamento|notifiche|dati|informazioni)\/?$/,
nav: 'impostazioni',
page: () => import('./pages/settings.js'),
},
{ pattern: /^\/browser\/?$/, nav: 'attivita', page: () => import('./pages/browser.js') },
];