What is the right way to set path?
in my app i this code for i use set path for sending file.
app.get('/',function(req, res){//get,put,post,delete
res.sendfile(__dirname + '/client/views/index.html');
});
but it give this error:
express deprecated res.sendfile: Use res.sendFile instead server.js:22:6
can some to point what is the error here.please
Change this
app.get('/',function(req, res){//get,put,post,delete
res.sendfile(__dirname + '/client/views/index.html');
});
to this and this should work.
app.get('/',function(req, res){//get,put,post,delete
res.sendFile(__dirname + '/client/views/index.html');
});
In new versions sendfile
has been deprecated. Change sendfile
to sendFile
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With