Skip to main content

@oak/acorn@1.1.0
Built and signed on GitHub Actions

A focused RESTful server framework 🌰

This package works with Cloudflare Workers, Node.js, Deno, Bun
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
JSR Score
100%
Published
2 months ago (1.1.0)

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.

I
CloudflareExecutionContext

The execution context that is passed to the Cloudflare Worker fetch handler.

I
CloudflareFetchHandler

The interface that defines the Cloudflare Worker fetch handler.

c
Context

Provides an API for understanding information about the request beingprocessed by the router.

I
ErrorDetails

Details provided an onError hook.

I
HandledDetails

Details provided to an onHandled hook.

I
InvalidHandler

A function that can be called when a schema is invalid.

I
LoggerOptions

Options which can be set when configuring the logger when creating a newrouter.

I
NotFoundDetails

Details provided to an onNotFound hook.

c
PathRoute

Encapsulation of logic for a registered router handler.

I
RequestEvent

The abstract interface that defines what needs to be implemented for arequest event.

I
Route

The abstract interface that needs to be implemented for a route.

I
RouteDescriptor

The description of a route which can be used when registering a route withthe Router, which incorporates the path, handler, and otherroute specific options.

I
RouteDescriptorWithMethod
No documentation available
I
RouteHandler

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.

I
RouteInit

Options which can be provided when creating a route.

I
RouteInitWithHandler

Options which can be provided when creating a route that also include thehandler.

I
RouteOptions

Options which can be set with on a route, related to how matching against apath pattern works.

T
RouteParameters

A type which supports inferring parameters that will be parsed from theroute.

c
Router

The main class of acorn, which provides the functionality of receivingrequests and routing them to specific handlers.

I
RouterOptions

Options which can be specified when creating an instance ofRouter.

I
SchemaDescriptor

A descriptor for a schema that can be applied to a request and response.

I
StatusHandler

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.

T
StatusRange

A string that represents a range of HTTP response Status codes:

c
StatusRoute

Encapsulation of logic for a registered status handler.

I
StatusRouteDescriptor

The descriptor for defining a status route.

N
v
No documentation available
T
ValidationOptions

Validation options which can be applied when validating.