Basic Node and Express - Serve Static Assets

Tell us what’s happening:
I am trying to complete the challenge and it does not work. I literally copy and paste the solution from the forum and it is not working. I don´t know why.

This is my code

let express = require('express');
let app = express();

app.use("/public", express.static(__dirname + "/public"));

app.get("/", (req, res) => {
  res.sendFile(`${__dirname}/views/index.html`);
});

Your project link(s)

solution: boilerplate-express-1 - Replit

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36

Challenge: Basic Node and Express - Serve Static Assets

Link to the challenge:

The code I see in your replit is not what you have written above. The difference is in the following two lines in your replit:

const publics = __dirname + '/public'
app.use("public", express.static(publics))

HINT: Look closely at the route you specify in app.use.