title: How to get data from render in node.js
body: <p>I need to get <code>nickname</code> and <code>room</code> from the code below in my frontend JS file. 
  Nickname and room are taken from form(POST method). Is there any possibility to get it in simple way?</p>
  
  <p>server:
  <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>exports.chatroom = (req, res) =&gt; {
      res.render('chatroom', {
          nickname: req.body.nickname,
          room: req.body.room
      });
  };</code></pre>
  </div>
  </div>
  </p>
  
  <p>client:</p>
  
  <pre><code>console.log('here my room and nickname');
  </code></pre>