nori/codegen/gleam_routes
Generates server-side route matching as string output.
Produces a Gleam module with a Route union type and a match_route function that pattern-matches HTTP method + path segments.
Values
pub fn generate(
ir: ir.CodegenIR,
module_prefix: String,
) -> String
Generates a complete Gleam routes module string from the CodegenIR.
module_prefix is the Gleam module path of the types module (e.g.
"generated" for ./src/generated, or "shared/generated" when the config
splits the output across projects). When non-empty it’s used to emit real
imports; when empty a comment hint is produced instead.
pub fn to_pascal_case(name: String) -> String
Convert a name to PascalCase. See naming.to_pascal_case.
pub fn to_snake_case(name: String) -> String
Convert a name to snake_case. See naming.to_snake_case.