https://github.com/antyfive/teo-body-parser
Teo.JS body parser
https://github.com/antyfive/teo-body-parser
Last synced: 9 months ago
JSON representation
Teo.JS body parser
- Host: GitHub
- URL: https://github.com/antyfive/teo-body-parser
- Owner: Antyfive
- License: mit
- Created: 2017-01-15T10:56:51.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-01-15T14:42:37.000Z (over 9 years ago)
- Last Synced: 2025-10-03T22:46:59.572Z (9 months ago)
- Language: JavaScript
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# teo-body-parser
Teo.JS body parser middleware based on Express.js [body-parser](https://github.com/expressjs/body-parser) module.
This module provides support for all of the wrapped API:
* [JSON body parser](https://github.com/expressjs/body-parser#bodyparserjsonoptions)
* [Raw body parser](https://github.com/expressjs/body-parser#bodyparserrawoptions)
* [Text body parser](https://github.com/expressjs/body-parser#bodyparsertextoptions)
* [URL-encoded form body parser](https://github.com/expressjs/body-parser#bodyparserurlencodedoptions)
## Teo.JS Config Example
```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
}
}
],
```