Built and signed on GitHub ActionsBuilt and signed on GitHub Actions
A focused RESTful server framework 🌰
default
acorn is a focused framework for creating RESTful JSON services acrossvarious JavaScript and TypeScript runtime environments including Denoruntime, Deno Deploy, Node.js, Bun and Cloudflare Workers.
The execution context that is passed to the Cloudflare Worker fetch handler.
The interface that defines the Cloudflare Worker fetch handler.
Provides an API for understanding information about the request beingprocessed by the router.
Details provided an onError
hook.
Details provided to an onHandled
hook.
A function that can be called when a schema is invalid.
Options which can be set when configuring the logger when creating a newrouter.
Details provided to an onNotFound
hook.
Encapsulation of logic for a registered router handler.
The abstract interface that defines what needs to be implemented for arequest event.
The abstract interface that needs to be implemented for a route.
The description of a route which can be used when registering a route withthe Router
, which incorporates the path, handler, and otherroute specific options.
A function that handles a route. The handler is provided aContext
object which provides information about the requestbeing handled as well as other methods for interacting with the request.A handler can return a Response
object, a value that can beserialized to JSON, or undefined
. If a value is returned, it will bevalidated against the response schema of the route. If undefined
isreturned, the response will be handled as a 204 No Content
response.
Options which can be provided when creating a route.
Options which can be provided when creating a route that also include thehandler.
Options which can be set with on a route, related to how matching against apath pattern works.
A type which supports inferring parameters that will be parsed from theroute.
The main class of acorn, which provides the functionality of receivingrequests and routing them to specific handlers.
Options which can be specified when creating an instance ofRouter
.
A descriptor for a schema that can be applied to a request and response.
A function that handles a status route. The handler is provided aContext
object which provides information about the requestbeing handled as well as other methods for interacting with the request.The status is also provided to the handler, along with the current response.
A string that represents a range of HTTP response Status
codes:
Encapsulation of logic for a registered status handler.
The descriptor for defining a status route.
Validation options which can be applied when validating.