Thursday, 20 April 2017

express sendFile breaks

I am constantly getting:

express deprecated res.sendfile: Use res.sendFile instead 

here is my code:

app.get('/*', function (req, res) {

  var myUrl = req.url.split('/')[1];

  myownfunction(myUrl, function (err, rows) {

    if (rows.length != 0) {
      res.sendfile('views/article.html');
    }
    else
    {
      res.sendfile('views/404.html');
    }
  });
});

I changed the sendfile to uppercase sendFile, but it breaks. what should i do?



via passion

No comments:

Post a Comment