title: Handling a GET request in Node.js Express server: res.render(file.ejs, data) not working because data is not defined
body: <p>In a server made with Express in Node.js, I have the following code for handling a GET request:</p>
  
  <pre><code>function articleReturner(celien) { // function querying a database (celien is a string, cetarticle is a JSON)
      Article.findOne({ lien: celien}, function (err, cetarticle){ 
                  console.log(cetarticle); // it works
                  return cetarticle;
      });
  }
  
  app.get('/selection/oui/', function(req, res) { // the URL requested ends with ?value=http://sweetrandoms.com, for example
      var celien = req.param("value"); // 
      console.log(celien); // it works
      articleReturner(celien); // calling the function defined above
      res.render('selection_form.ejs', cetarticle); // doesn't work!
      });
  </code></pre>
  
  <p>I know that data from the URL routing is correctly obtained by the server since the console correctly displays <code>celien</code> (a string). I also know that the <code>function articleReturner(celien)</code> is correctly querying the database because the console correctly displays <code>cetarticle</code> (a JSON). </p>
  
  <p>But <code>res.render('selection_form.ejs', cetarticle);</code> is not working and the console displays <code>ReferenceError: cetarticle is not defined</code>... What am I missing? Thanks!</p>