precondition
precondition(
options?):Function
Defined in: http/precondition.js:43
Create a precondition enforcement middleware.
Parameters
Section titled “Parameters”options?
Section titled “options?”methods?
Section titled “methods?”string[] | Set<string>
HTTP methods to enforce on. When omitted, enforces unconditionally (the pipeline builder handles method scoping). When provided, only activates for the specified methods.
Returns
Section titled “Returns”Function
- Middleware
(req) => voidthat returns{response: {statusCode: 428}}if no conditional header is present