Skip to main content
Module

x/composium/mod.ts

Powered by functional composition and the URL Pattern API, composium has become the most flexible routing framework in the world.
Go to Latest
import * as composium from "https://deno.land/x/composium@v0.0.5/mod.ts";

Classes

The extendable Context is passed as only argument to your CtxHandlers. You can optionally extend the default Context object or pass a State type.

Variables

Composes single-argument functions from right to left. The rightmost function can take multiple arguments as it provides the signature for the resulting composite function. It accepts sync and async functions.

Composes single-argument functions from right to left. The rightmost function can take multiple arguments as it provides the signature for the resulting composite function. The function composeSync doesn't accept async functions but composes non-async functions faster than compose does.

Functions

A curried function which takes Context class, mainHandlers, catchHandlers and finallyHandlers and returns in the end a Handler function which can be passed to listen.

A curried function which takes HTTP Methods, a URLPatternInput and CtxHandlers and returns in the end a composed route function.

A curried function which constructs a server, creates a listener on the given address, accepts incoming connections, upgrades them to TLS, and handles requests.