Routing

The directory tree under app/routes is the route table.

Updated 1 min read

A file's location determines its path; the procedures it declares determine its kind. Only .chpl files are scanned — there is no template format and no second file type.

FileRoute
routes/index.chpl/
routes/about.chpl/about
routes/posts/index.chpl/posts
routes/posts/[id].chpl/posts/[id]
routes/docs/[...path].chpl/docs/[...path]
routes/api/health.chpl/api/health

index contributes no segment. There is no distinction between page directories and API directories: /api above is a naming choice, not a convention the framework enforces.

In this section