Skip to main content
The Archery router maps requests to asynchronous Dart handlers; you will define routes, share prefixes and middleware, and consume validated path parameters.

Register methods

Router provides get, post, put, patch, and delete. Each accepts a path, a Future<dynamic> Function(HttpRequest) handler, and optional route middleware.
lib/src/http/routes/api.dart
Groups combine nested prefixes and prepend their middleware to route-specific middleware.
lib/src/http/routes/api.dart

Use typed parameters

Declare parameters as {name:type}. Supported types are int, double, uuid, and string. Retrieve the coerced value through RouteParams.get<T>().
lib/src/http/routes/web.dart
The router tries exact static routes before dynamic routes. It normalizes trailing slashes and accepts _method from the query string as a method override.
An unknown request method falls back to GET in the current router implementation. Restrict methods at your reverse proxy if you require rejection instead.