UNPKG

serverless-aws-lambda

Version:

AWS Application Load Balancer and API Gateway - Lambda dev tool for Serverless. Allows Express synthax in handlers. Supports packaging, local invoking and offline ALB, APG, S3, SNS, SQS, DynamoDB Stream server mocking.

22 lines (21 loc) 932 B
import type { IRequest } from "./express/request"; import type { IResponse } from "./express/response"; export type { IRequest, IResponse }; export type NextFunction = (error?: any) => void; export type RouteMiddleware = (error: any, req: IRequest, res: IResponse, next: NextFunction) => Promise<void> | void; export type RouteController = (req: IRequest, res: IResponse, next: NextFunction) => Promise<void> | void; declare class Route extends Function { controllers: (RouteController | RouteMiddleware | Function)[]; constructor(); _call(...args: any[]): Promise<any>; /** * Express like route.ANY() without path filter. * @deprecated use `.use()` instead. */ handle(...controllers: (RouteController | Function)[]): this; /** * Express like route.use() */ use(...middlewares: (RouteMiddleware | RouteController | Function)[]): this; } export declare const Router: () => Route;