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 months 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 (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-08-19T18:28:21.000Z (over 6 years ago)
- Last Synced: 2025-03-25T11:02:39.963Z (11 months 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: 2
- 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 git@github.com: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