only match the route added last when its param matches regex.
Else the route does not match, and the next route is tried (or the
client gets 404). The regex must match the whole param text. Use
(?:...) for groups, not (...). The value is checked again after
% decoding, so the decoded text must match too (a %20 is a space
then).
turn the route param param into a value before the controller
runs. resolve gets the raw text and gives the value, or null
when there is none: then the request gets 404.
read it with req.bound<T>(param), or add a controller parameter
of type T. call it before the server starts.
the route for a GET or HEAD request that matches no other route and
no staticFiles file. Use it for a custom 404 page, or to send
index.html of a single page app. Other methods still get 404 or 405.
send every request under prefix straight to handler, before
routing and body reading. the handler writes and closes the
response itself. Socket.IO uses this for /socket.io/.
url with a signature query param, so the link can not be
changed. Check it with the ValidateSignature middleware. With
expires, the url also has an expires param (unix seconds) and
stops working after that time.
serve the files in folder under prefix, for GET and HEAD
requests that match no route. Routes always win, so a normal
request does not touch the disk. No middleware runs for a file.
Like other routes, prefix follows group, the router prefix and
domain. folder is relative to the folder the app starts in.
Never save user uploads in folder: an uploaded html or svg file
would run its script on your site. Use dox_storage for them.
.., dot files (like .env) and folders are never sent: they get
404. Only a .well-known folder at the top of folder is sent.
A file gets ETag and Last-Modified (and 304 when the browser has it),
Range support, and Cache-Control: public, max-age=... with
maxAge. Give hashed build files (like Vite's) a long maxAge.
the path of the route named name, with its {params} filled in.
a param value is url encoded. query is added as the query string.
an unknown name or a missing param throws an ArgumentError.
a route for the WebDAV VIEW HTTP method. It does not render a
template like Laravel Route::view. For that, use a GET route:
Route.get('welcome', (DoxRequest req) => view(req, 'welcome'))
with view() of dox_view.
raw WebSocket route. handler gets the open socket.
Middleware runs first, so it can check auth.
For rooms, acks and the socket.io clients, use dox_socketio.