UNPKG

nextjs-api-router

Version:

Lightweight tool to build clean restful API routes for your Next.js application.

13 lines (12 loc) 457 B
import { NextApiRequest, NextApiResponse } from "next"; import { Controller, Handler } from "./types"; export declare class Router { controller: Controller; private _middleWare; constructor(controller?: Controller); handle(controller?: Controller): (req: NextApiRequest, res: NextApiResponse) => Promise<unknown>; use(...handlers: Handler<any>[]): void; private execRoute; private execMiddleware; private methodNotAllowed; }