Serve static assets

Tell us what’s happening:

Your code so far

Your browser information:

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

Challenge: i need help please… my serve static assets challenge on express is not working

Link to the challenge:
https://www.freecodecamp.org/learn/apis-and-microservices/basic-node-and-express/serve-static-assets

Can you show your code here please? I can’t do anything if I don’t see how you’ve worked on it.

1 Like

Have you set this up on a glitch or something? In order to help you, we really need to see where things stand.

Try another browser ok?

1 Like

/** 1) Meet the node console. */
console.log(“Hello World”);

/** 2) A first working Express Server */
//app.get("/", (req, res) => {res.send(“Hello Express”);});

/** 3) Serve an HTML file */
app.get("/", function(req, res) {
res.sendFile(__dirname + “/views/index.html”);
});

/** 4) Serve static assets */
app.use("/assets", express.static(__dirname + “/public”));

That’s it at **4, what should be done please?