middleware-body
HTTP request body parser middleware for Marble.js.
Installation
Requires @marblejs/core
to be installed.
Importing
Usage
app.ts
Lets assume that we have the following CURL command, which triggers POST api/login
endpoint:
Using previously connected bodyParser$
middleware, the app will intercept the following payload object:
where the POST request body can be intercepted inside sample Effect like follows:
dummyLogin.effect.ts
All properties and values in req.body
object are untrusted and should be validated before trusting.
This middleware does not handle multipart bodies.
Last updated