-
Notifications
You must be signed in to change notification settings - Fork 588
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
socket.io.js 404, what am i missing? #7
Comments
did you run npm install first? package.json lists the dependencies of this app, and you should use npm to install them. |
@toddp, yes i did! |
hmm ok now I reproduce this. This may be related to new Express syntax: http://stackoverflow.com/questions/10191048/socket-io-js-not-found I've managed to eliminate the socket.io error with the following diff, but I still have other problems such as can not view list of wines. diff --git a/server.js b/server.js
index f7005f3..ccc1f22 100644
--- a/server.js
+++ b/server.js
@@ -4,7 +4,8 @@ var express = require('express'),
wine = require('./routes/wines');
var app = express();
-
+var server = http.createServer(app);
+var io = require('socket.io').listen(server);
app.configure(function () {
app.set('port', process.env.PORT || 3000);
app.use(express.logger('dev')); /* 'default', 'short', 'tiny', 'dev' */
@@ -18,6 +19,6 @@ app.post('/wines', wine.addWine);
app.put('/wines/:id', wine.updateWine);
app.delete('/wines/:id', wine.deleteWine);
-http.createServer(app).listen(app.get('port'), function () {
+server.listen(app.get('port'), function () {
console.log("Express server listening on port " + app.get('port'));
}); |
I Have the same problem, any updates? |
I think the maintainer needs to look at this. |
I too can't see the list of wines...
|
I can't see the list of wines too :( |
There is no data in collection wines, you need to call populateDB() once to insert records into it first |
For socket.io.js 404 issue, the socket.io client js is missing, you need to copy the /nodecellar/node_modules/socket.io/node_modules/socket.io-client/dist/socket.io.js into folder /nodecellar/public/socket.io/socket.io.js . |
@TonyLuo You don't need to copy socket.io.js if you run the node serverwithanalytics.js as socket.io will generate this endpoint (well, this works for me anywayz). |
I had this problem. I can confirm that you have to install MongoDB in order to get it to work. You can follow instructions here: http://docs.mongodb.org/manual/installation/ If you wish to run it locally, make sure to run a "mongod" (not mongo) before running "node server" |
<script src="node_modules\socket.io-client\dist\socket.io.js"></script> |
KittPhi |
I just cloned this repo, and ran it, i keep on getting a 404 for socket.io.js:
GET http://localhost:4000/socket.io/socket.io.js 404 (Not Found)
What am i doing wrong?
The text was updated successfully, but these errors were encountered: