Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/amazingandyyy/body-parser
👷 A simple body parser middleware for node-server or ExpressJS.
https://github.com/amazingandyyy/body-parser
body-parser expressjs http https node-server nodejs openjs opensource scratchese server util
Last synced: 11 days ago
JSON representation
👷 A simple body parser middleware for node-server or ExpressJS.
- Host: GitHub
- URL: https://github.com/amazingandyyy/body-parser
- Owner: amazingandyyy
- License: mit
- Created: 2019-08-15T01:48:13.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2019-08-19T18:28:21.000Z (about 5 years ago)
- Last Synced: 2024-10-12T18:50:52.105Z (26 days ago)
- Topics: body-parser, expressjs, http, https, node-server, nodejs, openjs, opensource, scratchese, server, util
- Language: JavaScript
- Homepage:
- Size: 13.7 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
👷 body-parser
A simple body parser middleware for node-server or ExpressJS.> Zero dependency
> less than 40 lines
> compatible to ExpressJS## Installation
```shell
$ git clone [email protected]:amazingandyyy/body-parser.git
```## Usage
### ExpressJS
```javascript
const express = require('express')
const bodyParser = require('@amazingandyyy/body-parser')
const app = express()app.use(bodyParser)
app.post('/content', function (req, res) {
console.log(req.body)
res.send(req.body)
})app.listen(3000)
```### Node-Server
```javascript
const NodeServer = require('@amazingandyyy/node-server')
const nodeServerParser = require('@amazingandyyy/body-parser');const app = new NodeServer()
app.use(nodeServerParser)
app.on('post', '/content', (req, res)=>{
console.log(req.body)
res.send(req.body)
})app.start({ port: 4000 })
```
## License
MIT