import { Application } from "https://deno.land/x/dactyl@v0.1.0-alpha/deps.ts";
A class which registers middleware (via .use()
) and then processes
inbound requests against that middleware (via .listen()
).
The context.state
can be typed via passing a generic argument when
constructing an instance of Application
.
Constructors
Properties
A set of keys, or an instance of KeyStack
which will be used to sign
cookies read and set by the application to avoid tampering with the
cookies.
Generic state of the application, which can be specified by passing the generic argument when constructing:
const app = new Application<{ foo: string }>();
Or can be contextually inferred based on setting an initial state object:
const app = new Application({ state: { foo: "bar" } });
Methods
Start listening for requests, processing registered middleware on each
request. If the options .secure
is undefined or false
, the listening
will be over HTTP. If the options .secure
property is true
, a
.certFile
and a .keyFile
property need to be supplied and requests
will be processed over HTTPS.
Start listening for requests, processing registered middleware on each
request. If the options .secure
is undefined or false
, the listening
will be over HTTP. If the options .secure
property is true
, a
.certFile
and a .keyFile
property need to be supplied and requests
will be processed over HTTPS.
Register middleware to be used with the application.