diff --git a/src/static/js/routes/route_main.mjs b/src/static/js/routes/route_dashboard.mjs similarity index 100% rename from src/static/js/routes/route_main.mjs rename to src/static/js/routes/route_dashboard.mjs diff --git a/src/static/js/routes/route_table.mjs b/src/static/js/routes/route_table.mjs new file mode 100644 index 0000000..eed3e82 --- /dev/null +++ b/src/static/js/routes/route_table.mjs @@ -0,0 +1,6 @@ +"use strict"; + +export default async function(params) { + console.log(`TABLE ${params.table_name}`); + +} diff --git a/src/static/js/routes_client.mjs b/src/static/js/routes_client.mjs index b776235..5eb14bf 100644 --- a/src/static/js/routes_client.mjs +++ b/src/static/js/routes_client.mjs @@ -1,6 +1,7 @@ import ClientRouter from 'powahroot/Client.mjs'; -import route_main from './routes/route_main.mjs'; +import route_dashboard from './routes/route_dashboard.mjs'; +import route_table from './routes/route_table.mjs'; export default function make_routes() { const router = new ClientRouter({ @@ -8,7 +9,10 @@ export default function make_routes() { listen_pushstate: true }); - router.add_page("", route_main); + router.add_404(() => router.navigate("")); + + router.add_page("table/:table_name", route_table); + router.add_page("", route_dashboard); return router; }