How to use the morgan.common function in morgan

To help you get started, we’ve selected a few morgan examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Pomegranate / Pomegranate / lib / Server / Middleware.js View on Github external
/**
 * @file Middleware
 * @author Jim Bulkowski 
 * @project Pomegranate
 * @license MIT {@link http://opensource.org/licenses/MIT}
 */

var _ = require('lodash');
var fs = require('fs');
var path = require('path');
var responseTime = require('response-time');
var serveStatic = require('serve-static');
var compress = require('compression');
var morgan = require('morgan');
var logCommon = morgan.compile(morgan.common);
var bodyParser = require('body-parser');
var session = require("express-session");
var RedisStore = require('connect-redis')(session);
var favicon = require('serve-favicon');
var chalk = require('chalk');
/**
 * Manages middlewares.
 * @module Middleware
 */

module.exports = function(logger, redis){

  return {
    Session: function(opts){
      if(!opts){
        logger.log('ExpressConfig: Session Middleware not loaded.')

morgan

HTTP request logger middleware for node.js

MIT
Latest version published 4 years ago

Package Health Score

81 / 100
Full package analysis