import * as fresh from "https://deno.land/x/fresh@1.1.4/src/server/deps.ts";
Namespaces
N rutt | 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
Pretty-prints an analysis of the metafile JSON to a string. This is just for convenience to be able to match esbuild's pretty-printing exactly. If you want to customize it, you can just inspect the data in the metafile yourself. | |
A synchronous version of "analyzeMetafile". | |
This function invokes the "esbuild" command-line tool for you. It returns a promise that either resolves with a "BuildResult" object or rejects with a "BuildFailure" object. | |
A synchronous version of "build". | |
Converts log messages to formatted message strings suitable for printing in the terminal. This allows you to reuse the built-in behavior of esbuild's log message formatter. This is a batch-oriented API for efficiency. | |
A synchronous version of "formatMessages". | |
This configures the browser-based version of esbuild. It is necessary to call this first and wait for the returned promise to be resolved before making other API calls when using esbuild in the browser. | |
This function is similar to "build" but it serves the resulting files over HTTP on a localhost address with the specified port. | |
This function transforms a single JavaScript file. It can be used to minify JavaScript, convert TypeScript/JSX to JavaScript, or convert newer JavaScript to older JavaScript. It returns a promise that is either resolved with a "TransformResult" object or rejected with a "TransformFailure" object. | |
A synchronous version of "transform". | |
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 | |
Serves HTTP requests with the given handler. | |
Returns the media type associated with the file extension. Values are
normalized to lower case and matched irrespective of a leading | |
f walk | Walks the file tree rooted at root, yielding each file or directory in the tree filtered according to the given options. The files are walked in lexical order, which makes the output deterministic but means that for very large directories walk() can be inefficient. |
Interfaces
Information about the connection a request arrived on. | |
Documentation: https://esbuild.github.io/api/#serve-arguments | |
Documentation: https://esbuild.github.io/api/#serve-return-values | |
Additional serve options. |
Type Aliases
A handler for HTTP requests. Consumes a request and connection information and returns a response. | |
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 InternalRoute | internal route objects which the Routes | 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 | 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 |