I'm trying to render an index.html but I get the error enoent, even with the right path.
//folders tree
test/server.js
test/app/routes.js
test/public/views/index.html
//routes.js
app.get('*', function(req, res) {
res.sendFile('views/index.html');
});
//server.js
app.use(express.static(__dirname + '/public'));
require('./app/routes')(app);
I also tried
res.sendFile(__dirname + '/public/views/index.html');
If I use
res.sendfile('./public/views/index.html');
then it works, but I see a warning that says sendfile is deprecated and I have to use sendFile.