Esc

register_handler

procedureextensionexperimentalsince 0.36.1Source
  • macOS: register_handler works on macOS
  • Linux: register_handler works on Linux
  • Windows: register_handler works on Windows
  • Wasm: register_handler works on Wasm

Registers a callback without extractors, with separate caller-owned state for each route. The state must outlive serving; middleware and normal route matching still apply. Invalid/conflicting paths are reported by start like other routes.

Signature

register_handler :: (
    app: *App,
    method: Method,
    path: string,
    handler: Context_Handler,
    data: *void,
    max_body: s64 = 0
)
Example
register_handler(*app, .POST, "/example.Service/Method", callback, *service);

See also