title: Node Js TypeError with morgan: app.use is not a function
body: <p>I am new to node js and following a tutorial on <a href="https://scotch.io/tutorials/getting-started-with-node-express-and-postgres-using-sequelize" rel="nofollow noreferrer">scotch.io</a>. I've imported morgan for logging requests, but when I run the code I get <strong>TypeError: app.use is not a function</strong>. This is my code for app.js;</p>
  
  <pre><code>const express = require('express');
  const logger = require('morgan');
  const bodyParser = require('body-parser');
  
  const app = express;
  
  app.use(logger('dev'));
  
  app.use(bodyParser.json());
  app.use(bodyParser.urlencoded({ extended: false }));
  
  app.get('*', (req, res) =&gt; res.status(200).send({
      message: 'Welcome to deep thinking.'
  }));
  
  module.exports = app;
  </code></pre>
  
  <p>And for package.json:</p>
  
  <pre><code>{
    "name": "postgres-express-react-node-tutorial",
    "version": "1.0.0",
    "description": "",
    "main": "index.js",
    "scripts": {
      "start:dev": "nodemon ./bin/www",
      "test": "echo \"Error: no test specified\" &amp;&amp; exit 1"
    },
    "keywords": [],
    "author": "",
    "license": "ISC",
    "dependencies": {
      "body-parser": "^1.18.3",
      "express": "^4.16.3",
      "morgan": "^1.9.1"
    },
    "devDependencies": {
      "nodemon": "^1.18.4"
    }
  }
  </code></pre>