March Docs

Forge.Routes

Forge.Routes — forge bastion routes

Reads the project's router.march file(s) and prints all registered routes in a formatted table.

Route detection: scans for the comment convention: -- ROUTE: GET /path and also for bare match-arm patterns of the form: (:get, [...]) -> (:post, [...]) -> The two strategies are combined and de-duplicated.

Ported from cmd_bastion_routes.ml.

Types

typeParsedRouteParsedRoute = { method_str: String, path: String, handler: String }#

Functions

fnmainmain()#
fnrunrun()#

List all routes in the current Bastion project.

fnrun_genrun_gen()#

Generate a Routes module with typed path helpers.

Writes lib/<app>_routes.march with one helper function per unique path.

  forge bastion.routes --gen