API REFERENCE
Router Convention naming
In Rasengan.js, to create a router
, you have to create a file that follow the following name pattern:
txt[name].router.js
A router
is a set of pages grouped under the same layout
that share it.
TypeScript
JavaScript
tsximport { RouterComponent, defineRouter } from "rasengan"; import AppLayout from "@/app/app.layout"; import Home from "@/app/home.page"; import About from "@/app/about.page"; /* * This AppRouter is located inside the app.router.tsx file */ class AppRouter extends RouterComponent {} export default defineRouter({ imports: [], layout: AppLayout, pages: [Home, About], })(AppRouter);
Based on the convention, we have juste replace the [name]
by app
in the convention name and we got app.router.js
.
[name].page.tsx
rasengan.config.js