UNPKG

@teclone/r-server

Version:

A lightweight, extensible web-server with inbuilt routing-engine, static file server, file upload handler, request body parser, middleware support and lots more

28 lines (27 loc) 812 B
import type { MiddlewareInstance, RouteInstance, Method } from '../@types'; import { ServerRequest } from './Request'; import { ServerResponse } from './Response'; export declare class Engine { private resolved; private request; private response; private method; private path; constructor(path: string, method: Method, request: ServerRequest, response: ServerResponse); /** * capture route parameters */ private captureParameter; /** * runs through the route, and captures parameters */ private captureParameters; /** * check if route url matches request url */ private matchPath; /** * processes the route */ process(routeInstances: RouteInstance[], middlewareInstances?: MiddlewareInstance[]): Promise<boolean>; }