Help - Serving Static Asset

Help - Serving Static Asset
0

#1

Hi, I’m stuck on the serving a static asset challenge.

A middleware needs to be mounted using the method app.use(path, middlewareFunction). The first path argument is optional. If you don’t pass it, the middleware will be executed for all the requests.

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

This is my code below.

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

Any help is appreciated!


#2

Hi, are you getting any errors?


#3

GET https://equal-tablecloth.glitch.me/style.css/ net::ERR_ABORTED 404

That’s what I get in my console when I view the app live in Glitch. Otherwise I don’t see any errors!