New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

morgan-body

Package Overview
Dependencies
Maintainers
1
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

morgan-body

morgan logging req, res, and body

  • 0.9.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
15K
decreased by-6.73%
Maintainers
1
Weekly downloads
 
Created
Source

morgan-body

Example Use

Note: unlike typical express middleware you must pass the actual app into the function

import logger from 'morgan-body';
import express from 'express';
import bodyParser from 'body-parser';

const app = express();

// must parse body before logger as body will be logged
app.use(bodyParser.json());

// hook logger to express app
logger(app);

Sample Request+Body+Response Logging

Note: Actual console output is nicely colorized for iTerm2 :)

  Request: POST /login/ at Fri, 15 Jul 2016 03:13:48 GMT, User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36
  Body:
  {
  	"email": "rwcbeaman@gmail.com",
  	"password": "blahB3"
  }
  Response: 200 136.940 ms - -

Keywords

FAQs

Package last updated on 16 Jul 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc