glimr/config/route_group
Route Groups Configuration
Enables splitting compiled routes into separate files by URL prefix (e.g., /api/* vs /admin/*). This keeps generated route modules focused and allows different middleware stacks per group without runtime overhead.
Types
Compile-time configuration for grouping routes by URL prefix. The route compiler uses these to split routes into separate output files, each with its own middleware stack applied at compile time rather than runtime.
pub type RouteGroupConfig {
RouteGroupConfig(
name: String,
prefix: String,
middleware: kernel.MiddlewareGroup,
)
}
Constructors
-
RouteGroupConfig( name: String, prefix: String, middleware: kernel.MiddlewareGroup, )
Values
pub fn load() -> List(RouteGroupConfig)
Safe to call repeatedly since results are cached after first load. Returns empty list on missing/invalid config so the route compiler can fall back to a single default group.