Skip to main content
Deno 2 is finally here 🎉️
Learn more
Latest
method Router.prototype.all
Re-export
import { Router } from "https://deno.land/x/ptero@3.0/Ptero/deps.ts";

Register named middleware for the specified routes when the DELETE, GET, POST, or PUT method is requested.

Type Parameters

optional
P extends RouteParams = RP
optional
S extends State = RS

Parameters

name: string
path: string
middleware: RouterMiddleware<P, S>
...middlewares: RouterMiddleware<P, S>[]

Returns

Router<P extends RP ? P : (P & RP), S extends RS ? S : (S & RS)>

Register middleware for the specified routes when the DELETE, GET, POST, or PUT method is requested.

Type Parameters

optional
P extends RouteParams = RP
optional
S extends State = RS

Parameters

path: string
middleware: RouterMiddleware<P, S>
...middlewares: RouterMiddleware<P, S>[]

Returns

Router<P extends RP ? P : (P & RP), S extends RS ? S : (S & RS)>