title: ReferenceError: app is not defined: node.js
body: <p>I wants to get a dashboard page but unable to get it due to issues which are not fixing can I get help here</p>
  
  <p>userControler:</p>
  
  <pre><code>     const express = require('express');
       const router = express.Router();
       const mongoose = require('mongoose');
       const session = require('express-session');
       const passport = require('passport');
       const User = mongoose.model('User');
  
     app.router('/dashboard', (req, res) =&gt; { 
  console.log("test");
  User.find((err, docs) =&gt; { 
      if (!err) { res.render("dashboard", {
                     users: docs
                 });
       } else { 
          console.log('Error in retrieving users list :' + err);
           } 
       }); 
    });
  </code></pre>
  
  <p>route in app.js</p>
  
  <pre><code>   app.use('dashboard', userController);
  </code></pre>
  
  <p>dashboard.ejs:</p>
  
  <pre><code>    &lt;div class="form-group"&gt;
  &lt;label for="exampleInputPassword1"&gt;users&lt;/label&gt;
                                                                                                                            &lt;% users.forEach(function (users) { %&gt;
      &lt;select class="form-control" id="exampleInputEmail1"&gt;
         &lt;option&gt;&lt;%= users.name %&gt;&lt;/option&gt;
      &lt;/select&gt;
      &lt;% }) %&gt;
    &lt;/div&gt;
  </code></pre>
  
  <p>error:</p>
  
  <pre><code>   the options [userNewParser] is not supported
     D:\nodejs\node_app\controllers\userController.js:10
     app.router('/dashboard', (req, res) =&gt; {
     ^
  
     ReferenceError: app is not defined
  </code></pre>
  
  <p>dashboard.ejs:</p>
  
  <pre><code>    &lt;div class="form-group"&gt;
          &lt;label for="exampleInputPassword1"&gt;users&lt;/label&gt;
          &lt;% users.forEach(function (users) { %&gt;
          &lt;select class="form-control" id="exampleInputEmail1"&gt;
            &lt;option&gt;&lt;%= users.name %&gt;&lt;/option&gt;
          &lt;/select&gt;
          &lt;% }) %&gt;
        &lt;/div&gt;
  </code></pre>
  
  <p>app.js</p>
  
  <pre><code>   paste.ofcode.org/7zJVKxxhRan2KgskF37ixL
  </code></pre>