Skip to main content
Latest
class Application
import { Application } from "https://deno.land/x/lean@0.0.6/lib/app.ts";

Constructors

new
Application(options: ApplicationOptions)

Properties

readonly
compiler: Compiler
readonly
mode: Mode
readonly
rootUrl: URL

Methods

add(
method: string,
path: string,
requestHandler: RequestHandler<this>,
...middlewares: Middleware<this>[],
): Application
any(
path: string,
requestHandler: RequestHandler<this>,
...middleware: Middleware<this>[],
): Application
before(...middlewares: Middleware<this>[]): this

before adds middleware which is run before routing.

close(): Promise<void>
connect(
path: string,
requestHandler: RequestHandler<this>,
...middleware: Middleware<this>[],
): Application
delete(
path: string,
requestHandler: RequestHandler<this>,
...middleware: Middleware<this>[],
): Application
get(
path: string,
requestHandler: RequestHandler<this>,
...middleware: Middleware<this>[],
): Application
head(
path: string,
requestHandler: RequestHandler<this>,
...middleware: Middleware<this>[],
): Application
match(
methods: string[],
path: string,
requestHandler: RequestHandler<this>,
...middleware: Middleware<this>[],
): Application
options(
path: string,
requestHandler: RequestHandler<this>,
...middleware: Middleware<this>[],
): Application
patch(
path: string,
requestHandler: RequestHandler<this>,
...middleware: Middleware<this>[],
): Application
post(
path: string,
requestHandler: RequestHandler<this>,
...middleware: Middleware<this>[],
): Application
put(
path: string,
requestHandler: RequestHandler<this>,
...middleware: Middleware<this>[],
): Application
start(listenOptions: Deno.ListenOptions): void
trace(
path: string,
requestHandler: RequestHandler<this>,
...middleware: Middleware<this>[],
): Application
use(...middlewares: Middleware<this>[]): this

use adds middleware to be run after the router.