title: Error: Can't set headers after they are sent. Express.js
body: <p>Im kinda new at node and stack for a long time with this error. Please help me sovle my problem.
  Here is my code:</p>
  
  <pre><code>app.get('/', function(req , res){
  request(url, function(err, response, html){
  if (!err &amp;&amp; response.statusCode == 200){
    var page = cheerio.load(html);
    page('.search-result-description').each(function(){
      var data = [];
      var name = page(this).find('.search-result-item__head');
      var company = page(this).find('.search-result-item__company');
      var description = page(this).find('.search-result-item__snippet');
      var requirements = page(this).find('.search-result-item__snippet');
      var salary = page(this).find('.b-vacancy-list-salary');
  
      data.push({
        vac_name:  name.eq(0).text(),
        vac_description: description.eq(0).text(),
        vac_requirements: requirements.eq(0).text(),
        var_company: company.eq(0).text(),
        vac_salary : salary.eq(0).text()
      });
      data = JSON.stringify(data, null, 4);
      res.render('main.ejs', {data: data});
    });
    }
  });
  });
  </code></pre>