METHODS
Lowercase HTTP verb helpers passed straight to Express route registration.
The simple mental model
METHODS is a spelling-safe list of HTTP verbs—the labels on requests that say whether they read, create, replace, change, or delete something.
When should I use it?
Use it in Redweb service definitions to avoid scattered uppercase strings and accidental unsupported verbs.
Follow the example
This pattern explains the named API. Application classes, credentials, and assets may need to be supplied; use a complete recipe for a runnable starting point.
const { METHODS } = require('redweb')
// METHODS.GET, METHODS.POST, METHODS.PUT, METHODS.DELETE- 1
A service definition pairs its path with a METHODS value.
- 2
BaseHttpServer registers the matching Express operation.
- 3
Requests with another verb do not accidentally invoke that service.
Methods and members
GET
Use with services array or Express: METHODS.GET
POST
Use with services array or Express: METHODS.POST
PUT
Use with services array or Express: METHODS.PUT
DELETE
Use with services array or Express: METHODS.DELETE