req-control
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

req-control

Just a micro tool to check if post request params are present.

Usage

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

yarn add req-control

/req-control/

    Package Sidebar

    Install

    npm i req-control

    Weekly Downloads

    2

    Version

    0.0.1

    License

    MIT

    Unpacked Size

    3.07 kB

    Total Files

    12

    Last publish

    Collaborators

    • vdegenne