Creates a Fastify route handler that responds with 405 Method Not Allowed, advertising the permitted methods via the Allow header (RFC 9110 §10.2.1).
405 Method Not Allowed
Allow
Intended for the catch-all route of a path whose allowed methods are handled by separate route definitions, e.g.:
routes.set("INDEX_405", { method: ["DELETE", "PATCH", "POST", "PUT", "OPTIONS"], url: "/", handler: createMethodNotAllowedHandler(["GET", "HEAD"]),}) Copy
routes.set("INDEX_405", { method: ["DELETE", "PATCH", "POST", "PUT", "OPTIONS"], url: "/", handler: createMethodNotAllowedHandler(["GET", "HEAD"]),})
The HTTP methods permitted on the route, joined into the Allow response header (e.g. ["GET", "HEAD"]).
["GET", "HEAD"]
A Fastify route handler that sets the Allow header and throws a Boom 405 error.
405
Creates a Fastify route handler that responds with
405 Method Not Allowed, advertising the permitted methods via theAllowheader (RFC 9110 §10.2.1).Intended for the catch-all route of a path whose allowed methods are handled by separate route definitions, e.g.: