Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

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
```