Skip to content

Convenience function for easier reading of request data

License

Notifications You must be signed in to change notification settings

janis-kra/express-readbody

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

express-readbody

Convenience function for easier reading of request data.

Why?

Use this for a small project in which you just want the payload of a handful of POST or PUT requests to be read as a string. For anything more complex or big, you probably want to use the excellent body-parser middleware or something similar.

Installation

npm install --save express-readbody

Usage

const server = require('express')();
const readBody = require('express-readbody');

server.post('/hello', (req, res) => {
  readBody(req).then(body => console.log(body));
});

About

Convenience function for easier reading of request data

Resources

License

Stars

Watchers

Forks

Packages

No packages published