🛣️ File-System Routing
Learn how routes map to files in the src/app directory.
Routes are automatically generated based on the file structure inside the src/app directory. This makes it intuitive to structure your application without having to write complex configuration files.
Basic Routes
src/app/page.nim→ /src/app/docs/page.nim→ /docs
Dynamic Routes
You can define dynamic route parameters by prefixing the filename with p_ (parameter):
src/app/blog/p_id.nim→ /blog/:id
Inside p_id.nim, you can easily access the dynamic parameter through the Request object via req.pathParams["id"].