npm install teo-body-parserThis module provides support for all of the wrapped API:
* JSON body parser
* Raw body parser
* Text body parser
* URL-encoded form body parser
javascript
module.exports = {
protocol: "http",
host: "localhost",
port: 3100,
cluster: {
enabled: true
},
extensions: [
{
name: "body-parser",
module: "teo-body-parser",
config: {
// enables all parsers with the default options
json: true,
urlencoded: true,
raw: true,
text: true
}
}
],
};
`
When passing json: true - no options will be passed, and the parser will be enabled with the default options as bodyParser.json().Alternatively, if you want to pass the additional configuration options for some specific parser, just replace
true with your configuration object. E.g.`javascript
extensions: [
{
name: "body-parser",
module: "teo-body-parser",
config: {
json: true,
// will apply bodyParser.urlencoded({extended: true})
urlencoded: { extended: true },
raw: true,
text: true
}
}
],
``