Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
touchto-core / lib / jsonbody.js
Size: Mime:
import jsonbody from 'body/json';

const jsonheader = /json/i;

export default ( req, res, next ) => {
    if ( req.headers['content-type'] && jsonheader.test( req.headers['content-type'] ) ) {
        jsonbody( req, res, ( err, body ) => {
            if ( err !== null ) {
                next( err );
                return;
            }
            req.body = body;
            next();
        } );
    }
};