Basic Node and Express (Serve Static Assets)

I didn’t manage to output the css stylesheet using express.static on Repl.
is it something to do with the platform?

res.sendFile(__dirname + ‘/views/index.html’);

app.use(express.static(__dirname + ‘public’))

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.96 Safari/537.36.

Challenge: Serve Static Assets

Link to the challenge:

I’m also having the same issue, but I’m not sure why.

I do believe that the app.use() needs to be above the app.get() since Express looks at the routes at the top first, but I have my code ordered that way and it’s still not picking up the style.css

I got my solution to work by clicking the ‘open in new tab’ button in the preview window. That pulled in the CSS and solved the challenge.