import { rutt } from "https://deno.land/x/fresh@1.1.4/src/server/deps.ts";
Rutt is a tiny http router designed for use with deno and deno deploy. It is written in about 200 lines of code and is pretty fast, using an extended type of the web-standard URLPattern to provide fast and easy route matching.
Variables
All known HTTP methods. |
Functions
Builds an InternalRoutes array from a Routes record. | |
The default error handler for the router. By default it responds with | |
The default other handler for the router. By default it responds with | |
The default unknown method handler for the router. By default it responds
with | |
A simple and tiny router for deno |
Type Aliases
A handler type for anytime the | |
A handler for HTTP requests. Consumes a request and HandlerContext and returns an optionally async response. | |
Provides arbitrary context to Handler functions along with connection information. | |
The internal route object contains either a RegExp pattern or URLPattern which is matched against the incoming request URL. If a match is found for both the pattern and method the associated MatchHandler is called. | |
An array of internal route objects which the routes record is mapped into. This array is used internally in the router function and can even be passed directly to it if you do not wish to use the routes record or want more fine grained control over matches, for example by using a RegExp pattern instead of a URLPattern. | |
A handler type for a router path match which gets passed the matched values | |
A record of route paths and MatchHandlers which are called when a match is found along with it's values. | |
A handler type for anytime a method is received that is not defined |