import { NextFunction, Request, Response } from 'express'; /** * Sets Allow header. * * "The Allow header lists the set of methods support by a resource. * This header must be sent if the server responds with a 405 Method Not Allowed * status code to indicate which request methods can be used." * * * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Allow */ export const setAllowHeader = (req: Request, res: Response, next: NextFunction) => { res.set('allow', 'GET, POST, OPTIONS'); next(); };