I am using express version : express@4.12.3
And while supplying the static html i use the following:
app
.get('*', function (req, res) {
res.sendFile('public/main.html');
})
But I am getting error as :
TypeError: path must be absolute or specify root to res.sendFile
Instead if i use the res.sendfile
- works but i am getting error from cmd
saying to use sendFile
- what else i do? what is the issue here?
any one guide me please?