route.register
Expose new HTTP routes on the daemon router.
Paths must start with `/`. Duplicate method+path registrations fail at init. Plugin routes use the same Bearer auth middleware as the system API.
Pipeline
Plugin routes merge into the main Axum router alongside core API routes.
Use cases
- Custom webhooks and panel callbacks
- Plugin-specific REST APIs without forking FeatherFly
- Static JSON config endpoints for operators
Example
Registration and handler
Register
route!(host, HTTP_METHOD_GET, "/plugins/hello", on_hello);Handler
extern "C" fn on_hello(ctx: *const RouteHandlerContext) -> i32 {
let ctx = unsafe { &*ctx };
write_route_response(ctx, 200, br#"{"plugin":"hello"}"#)
}