import * as reno from "https://deno.land/x/reno@v2.0.75/reno/mod.ts";
Classes
An error that's thrown by Reno when a route
for a particular request's path cannot be found in the
router's route map. You won't need to instantiate and
throw this directly, but it's exported to support
|
Functions
A unit testing utility to assert that
| |
Creates a | |
Creates a Reno router for the given routes, which can then be invoked as an async function when Deno's HTTP server receives a request: | |
Takes mappings of HTTP methods and route handler functions, and returns a higher-order route handler that will forward requests to the correct handler by their method. Any requests whose method does not have an associated handler will result in a HTTP 405: | |
A response creator function for building JSON responses, that: defaults the Content-Type header to "application/json"; and serialises the JSON body to a string that's then encoded as a Uint8Array | |
A response creator function for building stream responses. This one currently doesn't do anything special, but it at least saves the effort of having to create response objects manually, and in the future may contain some sort of enhancing behaviour | |
Assigns the provided cookies to the underlying Response instance, which
are then sent to the requestor via multiple | |
A higher-order function that takes a route handler function and
returns another route handler that parses form data bodies before
invoking the inner handler. The data is parsed internally by
creating a | |
A higher-order function that takes a route handler function and returns another route handler that parses JSON bodies before invoking the inner handler: |
Type Aliases
The standard request type used througout Reno, which is passed to user-defined route handler functions. Mostly identical to std/http's ServerRequest, except the inclusion of Reno-specific props for ease of use. | |
The standard response type returned by route handler functions. Essentially the same as std/http's Response, but also exposes cookies as an array of [string, string] tuples. | |
A ProcessedRequest with a body type reflecting a URLSearchParams instance. | |
A union of all possible HTTP methods, as uppercase strings, since deno/std doesn't provide one. | |
A ProcessedRequest that allows the body type to be specified via the sole type parameter. Defaults to an empty object. | |
An AugmentedRequest with an additional property
containing the body after it has been parsed or
processed, typically by one of the built-in
middlewares. For example, the | |
A user-defined route handler for a particular route. | |
A standard ECMAScript | |
The router function returned by | |
A function that takes a routes map and returns an invocable router function. |