Error Can not GET /index.html Node JS

0

I think the problem is in assigning routes, which I tried to do but with no success.

    
asked by anonymous 20.10.2018 / 21:21

1 answer

0

Good Alexandre,

I think the problem is that the "index.html" file is not being sent to the GET request.

var path = require('path');

app.get('/', function(req, res) {
    res.sendFile(path.join(__dirname + '/index.html'));
});

I hope I have helped:)

    
22.10.2018 / 16:48