Module

x/fresh/src/server/deps.ts

The next-gen web framework.
Extremely Popular
Go to Latest
import * as mod from "https://dotland.deno.dev/x/fresh@1.1.5/src/server/deps.ts";

Namespaces

Rutt is a tiny http router designed for use with deno and deno deploy. It is written in about 300 lines of code and is fast enough, using an extended type of the web-standard URLPattern to provide fast and easy route matching.

Enums

Standard HTTP status codes.

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".

This is the advanced long-running form of "build" that supports additional features such as watch mode and a local development server.

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.

A synchronous version of "transform".

Builds an {@link InternalRoutes} array from a {@link Routes} record.

The default error handler for the router. By default it responds with null body and a status of 500 along with console.error logging the caught error.

The default other handler for the router. By default it responds with null body and a status of 404.

The default unknown method handler for the router. By default it responds with null body, a status of 405 and the Accept header set to all {@link KnownMethod | known methods}.

A simple and tiny router for deno. This function provides a way of constructing a HTTP request handler for the provided {@link routes} and any provided {@link RouterOptions}.

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 ..

Walks the file tree rooted at root, yielding each file or directory in the tree filtered according to the given options.

Interfaces

Information about the connection a request arrived on.

Additional options for the {@link router} function.

A record of route paths and {@link MatchHandler}s which are called when a match is found along with it's 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 MatchHandler or other parameter handler fails

A handler for HTTP requests. Consumes a request and {@link HandlerContext} and returns an optionally async response.

Provides arbitrary context to {@link Handler} functions along with connection information.

The internal route object contains either a {@link 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 {@link MatchHandler} is called.

An array of {@link InternalRoute | internal route} objects which the {@link Routes | routes} record is mapped into. This array is used internally in the {@link router} function and can even be passed directly to it if you do not wish to use the {@link Routes | routes} record or want more fine grained control over matches, for example by using a {@link RegExp} pattern instead of a URLPattern.

A known HTTP method.

A handler type for a router path match which gets passed the matched values

A handler type for anytime a method is received that is not defined