Kevin Powell - CommunityKP-C
Kevin Powell - Community15mo ago
2 replies
Faker

Serving static files in express

Hello everyone, sorry to disturb you. I have a question regarding app.get(express.static()). Let's say we have a folder named public, and the path to this folder is passed as an argument. We noticed that if we have a stylesheet in this folder, the link to it in the HTML file doesn't need to be changed. When the server is running, the CSS is still parsed correctly. However, if we try to open the HTML file directly using the local server VS Code extension, it doesn't work.

Could anyone explain why this happens please.
Was this page helpful?