Basic Node and Express - Serve an HTML File - Please help

Basic Node and Express - Serve an HTML File - Please help
0

#1

I passed the challenge using a different way but what if I had to clear the challenge by just seeing the instructions provided?

https://learn.freecodecamp.org/apis-and-microservices/basic-node-and-express/serve-an-html-file

Here’s the code:

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

#2

I don’t understand your question.

Do you have an example?