Routing
Prism’s router matches incoming requests to handlers using URL patterns. It supports path parameters, wildcards, route groups, and nested prefixes.Basic Routes
Register routes with the HTTP method and a URL pattern:Basic Routes
route method:
Path Parameters
Capture dynamic URL segments with:paramName:
Path Parameters
Wildcards
The* wildcard matches any remaining path:
Wildcard Routes
Route Groups
Group related routes under a shared prefix. Groups can have their own middleware:Route Groups
GET /api/status— no auth requiredGET /api/admin/users— auth requiredPOST /api/admin/users— auth requiredDELETE /api/admin/users/:id— auth required
REST Resource Pattern
A common pattern for building RESTful APIs:REST Resource
Route Priority
Routes are matched in registration order. The first match wins:Query Parameters
Query parameters are automatically parsed from the URL:Query Parameters
Request
Learn how to extract data from incoming requests.
Middleware
Add cross-cutting concerns to route groups.