outers
Version:
outers - a all in one package for your day to day use
12 lines (11 loc) • 820 B
TypeScript
/// <reference types="qs" />
import { Request, NextFunction, Response } from "express";
/**
* Middleware function that validates the request method against a list of allowed methods.
* If the request method is not allowed, it sends an error response.
* @param Methods - Optional array of allowed methods. If not provided, all HTTP methods are allowed.
* @param reverse - Optional flag to reverse the validation. If true, the request method must not be in the allowed methods list.
* @returns The middleware function.
*/
declare const _default: (Methods?: string[], reverse?: boolean) => (Request: Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>, Response: Response<any, Record<string, any>>, Next: NextFunction) => void;
export default _default;