samedi 4 avril 2015

Nodejs server: Failed to load resource: the server responded with a status of 404 (Not Found)

I have a web server setted up in node.



var app = express();
app.use(express.static(PUBLIC_PATH));
server = require('http').createServer(app),
io = require('socket.io').listen(server);


i set the public path to my app's root public folder, where i keep my frontend, so when the server is deployed, it's /app/public


When i try to open a page, i see this in chrome's console



i Failed to load resource: the server responded with a status of 404 (Not Found)



The file in question is app.js which is located in my public folder. I do see requests from the web server for that certain file



2015-04-04T15:43:04.208178+00:00 heroku[router]: at=info method=GET path="/style.css" host=hive-badescuga.herokuapp.com request_id=2be0334e-e968-4397-8c2e-9c65c85fea22 fwd="188.25.247.211" dyno=web.1 connect=1ms service=6ms status=304 bytes=236


2015-04-04T15:43:04.203415+00:00 heroku[router]: at=info method=GET path="/app.js" host=hive-badescuga.herokuapp.com request_id=fc8c529c-7641-4df2-9b13-5fee9e1af365 fwd="188.25.247.211" dyno=web.1 connect=1ms service=7ms status=404 bytes=217


2015-04-04T15:43:09.152566+00:00 heroku[router]: at=info method=GET path="/style.css" host=hive-badescuga.herokuapp.com request_id=b89ded8e-5433-4b57-8c80-c2e7407d31b0 fwd="188.25.247.211" dyno=web.1 connect=1ms service=6ms status=304 bytes=236



What is the problem?


Aucun commentaire:

Enregistrer un commentaire