Basic Node and Express - Serve Static Assets

Tell us what’s happening:
I got the form to work ok but now the syles aren’t loading. Did I do something wrong?
My app

Your code so far

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

app.get("/", (req, res) => {
  res.sendFile(__dirname + "/views/index.html");
});
app.use(express.static(__dirname + "/public"));

module.exports = app;

Your browser information:

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

Challenge: Basic Node and Express - Serve Static Assets

Link to the challenge:

Should be

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

as stated in challenge

Mount the express.static() middleware to the path /public with app.use() . The absolute path to the assets folder is __dirname + /public

ok so my code:

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

app.get("/", (req, res) => {
  res.sendFile(__dirname + "/views/index.html");
});
app.use("/public", express.static(__dirname + "/public"));
module.exports = app;

My result
image

What do you see is the problem cause I can’t find it? :confounded:

My sandbox

for some reason I can’t figure out. It is working after I move the lines of code , forked it and refresh twice.

I wonder if it because I’m using VPN.

I don’t think there is a problem, your sandbox is working just fine :grinning:

this was the same problem for me
I hope you had already noticed what was wrong here
apprently you have to:
"Ctrl + C " everytime you want to check if the solution is correct or not
and then retype
npm start in the terminal again

I know, but I am a beginner
I hope this helps