title: EXPRESS: express.urlencoded IS NOT WORKING
body: <p>I don't know why  console.log(req.body) is not showing any output if anyone can explain why
  when I fill the details and submit it then req.body should print details in terminal but it shows nothing
  I am new to nodejs please also explain why actually it is not printing output</p>
  <p>code:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const express = require('express');
  const path = require('path');
  const app = express();
  
  //express related stuff
  app.use('/static',express.static('static'));
  app.use(express.urlencoded());
  
  //pug specific stuff 
  app.set('view engine', 'pug');
  app.set('views',path.join(__dirname,'views'));
  
  //endpoint
  
  app.get('/',(req,res)=&gt;{
      const con = "knowledge";
      const parans = {'title':'PUBG','content': con};
      res.status(200).render('index.pug',parans);
  });
  app.post('/',(req,res)=&gt;{
      console.log(req.body);
      const parans = {'message': 'your form has been submitted'};
      res.status(200).render('index.pug',parans);
  })
  
  //listen,port
  app.listen(80,()=&gt;{
      console.log("sucess on port 80");
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
      &lt;meta charset="UTF-8"&gt;
      &lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt;
      &lt;title&gt;#{title}&lt;/title&gt;
      style
          include ../static/style.css
  &lt;/head&gt;
  &lt;body&gt;
      &lt;nav&gt;
          &lt;ul&gt;
              &lt;li&gt;&lt;a href="/"&gt;HOME&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="/about"&gt;ABOUT&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="/joinus"&gt;JOIN_US&lt;/a&gt;&lt;/li&gt;
          &lt;/ul&gt;
      &lt;/nav&gt;
      &lt;h1&gt;HEADING&lt;/h1&gt;
      &lt;!--&lt;h2&gt;#{content}&lt;/h2&gt;
      &lt;p&gt;this is plain HTML using PUG&lt;/p&gt;--&gt;
      &lt;div class="container"&gt;
          &lt;form action="/" id="contact"&gt;
              &lt;input type="text" id="name" placeholder="ENTER YOUR NAME"&gt;
              &lt;input type="text" id="AGE" placeholder="ENTER YOUR AGE"&gt;
              &lt;input type="text" id="GENDER" placeholder="ENTER YOUR GENDER"&gt;
              &lt;button class="btn"&gt;Submit&lt;/button&gt;
          &lt;/form&gt;
      &lt;/div&gt; 
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>