Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vdegenne/req-control
Just a micro tool to check if post request params are present.
https://github.com/vdegenne/req-control
Last synced: about 2 months ago
JSON representation
Just a micro tool to check if post request params are present.
- Host: GitHub
- URL: https://github.com/vdegenne/req-control
- Owner: vdegenne
- Created: 2018-04-23T01:05:30.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-04-23T01:07:59.000Z (over 6 years ago)
- Last Synced: 2024-09-23T04:19:19.922Z (3 months ago)
- Language: TypeScript
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# req-control
Just a micro tool to check if post request params are present.
## Usage
```javascript
import * as control from 'req-control';
import * as express from 'express';const app = express();
app.use(express.urlencoded({extended: true}));app.post('/api/cheesburgers', (req, res) => {
if (control.post(req, res, 'cheese', 'beef')) {
// new cheeseburger(req.body.cheese, req.body.beef).save();
}
});...
```
## Installation
```bash
yarn add req-control
```