UNPKG

@dazejs/framework

Version:

Daze.js - A powerful web framework for Node.js

26 lines (25 loc) 906 B
import { Key } from 'path-to-regexp'; import { Application } from '../../foundation/application'; import { MiddlewareService } from '../middleware'; import { Request } from '../request'; import { Response } from '../response'; export declare class Route { app: Application; keys: Key[]; uri: string; methods: string[]; regexp: RegExp; controller: any; action: string; middleware: MiddlewareService; enctypt: boolean; constructor(uri: string, methods?: string[], controller?: any, action?: string); get pieces(): any[]; registerMiddleware(middleware: any, args: any[]): this; addMethod(method: string): this; parseMethods(methods?: string[]): string[]; getParams(requestPath: string): string[]; registerControllerMiddlewares(middlewares: any): this; match(requestPath: string): boolean; resolve(request: Request): Promise<Response>; }