route - multiple declarations

Struct route

UDA. You can use to filter requests using a function bool(Request request) { }

struct route(alias T) ;

Example

@endpoint
@route!(x => x.path.startsWith("/api"))
void api(Request r, Output o) { ... }

Alias route

UDA. You can use to filter requests using a path.

alias route(string path) = route!((r)=>comparePath!path(r));

Example

@endpoint
@route!"/hello.html"
void api(Request r, Output o) { ... }