title: express.js - basic application router not working
body: <p>I just creating a basic app, but it seems not working for me. any one help me to find the mistake?</p>
  <p>here is my code :</p>
  <pre><code>import express from &quot;express&quot;;
  
  const app = express();
  const router = express.Router();
  
  
  app.use((req, res, next) =&gt; {
      console.log(&quot;first middleware&quot;);
      next();
  });
  
  router.get(&quot;/a&quot;, (req, res, next) =&gt; {
      res.send(&quot;Hello this is route a&quot;);
  });
  
  router.post(&quot;/c&quot;, (req, res, next) =&gt; {
      res.send(&quot;Hello this is route c&quot;);
  });
  
  app.listen({ port: 8000 }, () =&gt; {
      console.log(&quot;Express Node server has loaded&quot;);
  });
  </code></pre>
  <p>Node version : <code>v14.17.5</code>
  Express version : <code>^4.17.1</code></p>
  <p>thanks in advance.</p>