Returns the first parsed request cookie value by name.
@eryx/http/App Module
JSON
Summary
Classes
Functions
API Reference
Classes
AppContext
Properties
Parsed request cookies from the Cookie header.
AppContext:json
AppContext:form
AppContext:multipart
AppContext:cookie
AppContext:send
AppContext:text
AppContext:html
AppContext:jsonResponse
AppContext:redirect
AppContext:setCookie
Appends a Set-Cookie response header.
AppContext:clearCookie
Clears a cookie with an expired Set-Cookie response header.
AppContext:sendFile
Streams a file as the response body.
App
Properties
App.new
A higher-level HTTP app/router layer built on top of HttpServer.
Use App.get, App.post, middleware, groups, and mounts to build Flask/FastAPI-style request routing without dropping to the low-level request-handler callback for every endpoint.
App:route
Registers a route handler for a method/path pair.
Parameters
HTTP method such as "GET" or "POST".
Route pattern beginning with /. Supports :param and trailing *splat.
Request handler for matching requests.
Optional route metadata such as a route name or route-local middleware.
Returns
Self, for chaining.
App:use
Registers middleware that wraps every route and mounted child app.
Parameters
Middleware callback receiving (ctx, next).
Returns
App
App:useSessions
Registers server-side session middleware and exposes ctx.session.
Parameters
Session middleware options.
Returns
App
App:error
Registers a handler for framework-generated status responses such as 404 or 405.
Parameters
HTTP status code to intercept.
Handler that returns the replacement response.
Returns
App
App:onError
Registers a catch-all exception handler for uncaught route or middleware errors.
Parameters
Recovery handler receiving (ctx, err).
Returns
App
App:mount
Mounts another app or router under a URL prefix.
Parent middleware runs before child middleware, and child routes see
ctx.mountPath / ctx.pathWithinMount.
Parameters
URL prefix such as "/api".
Child app/router to mount.
Returns
App
App:group
Creates and mounts a child router under a prefix, then optionally configures it.
Parameters
URL prefix such as "/api".
Optional callback invoked with the new child router.
Returns
The new child router.
App:urlFor
Builds a URL for a named route.
Parameters
Route name registered through options.name.
Optional path parameters to substitute into the route.
Optional query-string parameters to append.
Returns
The generated relative URL.
App:static
Mounts a static directory under a URL prefix.
Files are served for GET/HEAD requests only. Requests that attempt
path traversal are rejected. When fallthrough is true, missing files
continue to later routes instead of immediately returning 404.
Parameters
URL prefix such as "/assets".
Filesystem directory to expose.
Static file options.
Returns
App
App:get
Registers a GET route.
Parameters
Route pattern beginning with /.
Handler for matching requests.
Optional route metadata.
Returns
App
App:post
Registers a POST route.
Parameters
Route pattern beginning with /.
Handler for matching requests.
Optional route metadata.
Returns
App
App:put
Registers a PUT route.
Parameters
Route pattern beginning with /.
Handler for matching requests.
Optional route metadata.
Returns
App
App:delete
Registers a DELETE route.
Parameters
Route pattern beginning with /.
Handler for matching requests.
Optional route metadata.
Returns
App
App:patch
Registers a PATCH route.
Parameters
Route pattern beginning with /.
Handler for matching requests.
Optional route metadata.
Returns
App
App:head
Registers a HEAD route.
Parameters
Route pattern beginning with /.
Handler for matching requests.
Optional route metadata.
Returns
App
App:options
Registers an OPTIONS route.
Parameters
Route pattern beginning with /.
Handler for matching requests.
Optional route metadata.
Returns
App
App:any
Registers a route that matches any method.
Parameters
Route pattern beginning with /.
Handler for matching requests.
Optional route metadata.
Returns
App
App:websocket
Registers a WebSocket endpoint.
Parameters
Route pattern beginning with /.
Handler receiving (ctx, ws) after a successful upgrade.
Optional route metadata.
Returns
App
App:_match
App:_execute
App:_handle
App:handler
Returns a low-level HttpServer-compatible handler for this app.
Returns
(HttpServer.ServerRequest, ServerResponse.ServerResponse) -> ()
App:createServer
Creates a low-level HttpServer that dispatches through this app.
Parameters
Optional server options overriding app defaults.
Returns
HttpServer
App:listen
Starts listening with this app's handler.
This is a convenience wrapper around App.createServer followed by HttpServer.listen.
Parameters
Optional listener-ready callback receiving (host, port).
Optional server options overriding app defaults.
App:close
Closes the underlying server if this app is currently listening.
Functions
AppContextMethods:json
AppContextMethods:form
AppContextMethods:multipart
AppContextMethods:cookie
Returns the first parsed request cookie value for the given cookie name.
Parameters
Cookie name.
Returns
string?
AppContextMethods:send
AppContextMethods:text
AppContextMethods:html
AppContextMethods:jsonResponse
AppContextMethods:redirect
AppContextMethods:setCookie
Appends a Set-Cookie response header.
Parameters
AppContextMethods:clearCookie
Clears a cookie by setting it to an empty value with an expired timestamp.
Parameters
Cookie name.
Cookie attributes such as path or domain to target the existing cookie.
AppContextMethods:sendFile
Streams a file as the HTTP response body.
Parameters
Filesystem path to the file.
Optional response overrides.
Types
ResponseSpec
RouteOptions
Optional metadata for route registration helpers like App.get.
Route-local middleware that runs inside app/group middleware but before the handler.
WebSocket upgrade options, used by App.websocket.
SendFileOptions
Options for AppContext.sendFile.
CookieOptions
Options for setting response cookies from the app layer.