Skip to main content
Module

x/composium/mod.ts>Context

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

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

export class Ctx extends Context<{ start: number }> {
  pathname = this.url.pathname;
}

Constructors

new
Context(
request: Request,
connInfo: ConnInfo,
state?: S,
)

Type Parameters

optional
S extends State = DefaultState

Properties

connInfo: ConnInfo
error: Error | null
request: Request
response: Response
start: number
state: S
url: URL