Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Openshift can't find my css file

I managed to create a new app on Openshift and the basic template that they provided me with is working. The only thing I added to it is:

<head>
...
<link href="styles.css" rel="stylesheet">
</head>

and a file styles.css in the same directory as index.html. In the css file I just changed the footer to red. When I click on index.html my browser shows the changes, but when I upload the files to Openshift nothing changes and I get:

GET http://bgl-boardgamelab.rhcloud.com/styles.css 404 (Not Found)

I think I'm making some silly mistake, but can't figure what it is.

like image 524
Mariusz Avatar asked Jan 29 '26 16:01

Mariusz


1 Answers

Turns out I had to add the following to my .initializeServer function to serve all my static files:

self.app.use(express.static(__dirname));
like image 73
Mariusz Avatar answered Feb 01 '26 09:02

Mariusz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!