title: NodeJS and body-parser
body: <p>I tried to make a golden book width nodeJS. So I use body-parser to get my form's values and it works until I try to verify if my form is empty by this way : </p>
  
  <pre><code>app.post('/', (request, response) =&gt; {
  if(request.body.message === undefined) {
      console.log('Message : ' + request.body.message);
  
  }
  </code></pre>
  
  <p>When I try to run my server and test my form by pushing informations, the loading of the page is infinite. </p>
  
  <p>Can you help me please ?</p>
  
  <p>Here, the full code : </p>
  
  <pre><code>let express = require('express');
  let app = express();
  let bodyParser = require('body-parser');
  
  // moteur de template
  app.set('view engine','ejs');
  
  
  // MIDDLEWARE
  app.use('/assets', express.static('public'));
  app.use(bodyParser.urlencoded({ extended: true }));
  // parse application/json
  app.use(bodyParser.json());
  
  // ROUTE
  app.get('/', (request, response) =&gt;{
      response.render('pages/index');
  });
  
  app.post('/', (request, response) =&gt; {
      if(request.body.message === undefined) {
          console.log('Message : ' + request.body.message);
  
      }
  });
  
  app.listen(8080);
  </code></pre>