Router
import { Router } from "https://raw.githubusercontent.com/Caesar2011/denotrain/master/mod.ts";
class Router<S extends object = Obj, R extends object = Obj> { }
private handlers: HandlerObject<S, R>;
private generateHandlerEntry(
path: Path,
method: RequestMethod | null,
handler: RequestHandler<S, R>,
): HandlerEntry<S, R>;private matchPath(ctx: Context<S, R>, handler: HandlerEntry<S, R>): {
newSubPath: string;
addParams: {};
[_: string]: UrlEncodedValue;
rawParams: {};
} | null;[_: string]: string;
public add(
obj: RequestOptions | Path | RequestHandler<S, R>,
method: RequestMethod | null,
...handlers: RequestHandler<S, R>[],
): Router<S, R>;public delete(path: RequestOptions | Path | RequestHandler<S, R>, ...handlers: RequestHandler<S, R>[]): Router<S, R>;
public get(path: RequestOptions | Path | RequestHandler<S, R>, ...handlers: RequestHandler<S, R>[]): Router<S, R>;
public head(path: RequestOptions | Path | RequestHandler<S, R>, ...handlers: RequestHandler<S, R>[]): Router<S, R>;
public patch(path: RequestOptions | Path | RequestHandler<S, R>, ...handlers: RequestHandler<S, R>[]): Router<S, R>;
public post(path: RequestOptions | Path | RequestHandler<S, R>, ...handlers: RequestHandler<S, R>[]): Router<S, R>;
public put(path: RequestOptions | Path | RequestHandler<S, R>, ...handlers: RequestHandler<S, R>[]): Router<S, R>;
public use(path: RequestOptions | Path | RequestHandler<S, R>, ...handlers: RequestHandler<S, R>[]): Router<S, R>;
§Properties
§
app: Application<S, R>
[src]§Methods
§
generateHandlerEntry(path: Path, method: RequestMethod | null, handler: RequestHandler<S, R>): HandlerEntry<S, R> private
[src]§
add(obj: RequestOptions | Path | RequestHandler<S, R>, method: RequestMethod | null, ...handlers: RequestHandler<S, R>[]): Router<S, R>
[src]§
delete(...handlers: RequestHandler<S, R>[]): Router<S, R>
[src]delete(path: RequestOptions | Path | RequestHandler<S, R>, ...handlers: RequestHandler<S, R>[]): Router<S, R>
[src]§
get(...handlers: RequestHandler<S, R>[]): Router<S, R>
[src]get(path: RequestOptions | Path | RequestHandler<S, R>, ...handlers: RequestHandler<S, R>[]): Router<S, R>
[src]§
head(...handlers: RequestHandler<S, R>[]): Router<S, R>
[src]head(path: RequestOptions | Path | RequestHandler<S, R>, ...handlers: RequestHandler<S, R>[]): Router<S, R>
[src]§
patch(...handlers: RequestHandler<S, R>[]): Router<S, R>
[src]patch(path: RequestOptions | Path | RequestHandler<S, R>, ...handlers: RequestHandler<S, R>[]): Router<S, R>
[src]§
post(...handlers: RequestHandler<S, R>[]): Router<S, R>
[src]post(path: RequestOptions | Path | RequestHandler<S, R>, ...handlers: RequestHandler<S, R>[]): Router<S, R>
[src]§
put(...handlers: RequestHandler<S, R>[]): Router<S, R>
[src]put(path: RequestOptions | Path | RequestHandler<S, R>, ...handlers: RequestHandler<S, R>[]): Router<S, R>
[src]§
use(...handlers: RequestHandler<S, R>[]): Router<S, R>
[src]use(path: RequestOptions | Path | RequestHandler<S, R>, ...handlers: RequestHandler<S, R>[]): Router<S, R>
[src]