NodeJS and CSS

I have for two days now been trying to do something I have done 491248903284390284903284908902384901729047129041 times in the past as a web programmer and designer. I am simply trying to import a CSS document into my web project. I am very new to NodeJS from a server perspective. All I want to do is style my freaking website but I simply cannot figure it out. I have spent hours and hours on Google and various other resources even consulting fellow programmers and it still refuses to load my CSS.

 

I am getting a 404 error when I pass in my <link rel="stylesheet" href="/public/spreadsheets/style.css"> and nothing I do will fix it..

 

Any recommendations?

0
1 comment

Do you use express (http://expressjs.com/) to serve your application? If yes, are you static files served from public directory? If so, you need using URLs like

href='/spreadsheets/style.css'

as Express looks up the files relative to the static directory, so the name of the static directory is not part of the URL

 
0

Please sign in to leave a comment.