Reputation: 607
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.
Upvotes: 3
Views: 766
Reputation: 607
Turns out I had to add the following to my .initializeServer
function to serve all my static files:
self.app.use(express.static(__dirname));
Upvotes: 2
Reputation: 823
Try full path url like:
<link href="http://localhost/myproject/styles.css">
or
<link href="http://examplesite.com/styles.css">
Upvotes: 0
Reputation: 18734
try
<link rel='stylesheet' href='styles.css' type='text/css' media='all' />
Upvotes: 0