nodecellar
nodecellar copied to clipboard
socket.io.js 404, what am i missing?
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?
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... On Feb 12, 2013 4:12 PM, "Todd Pinkerton" [email protected] wrote:
I think the maintainer needs to look at this.
— Reply to this email directly or view it on GitHubhttps://github.com/ccoenraets/nodecellar/issues/7#issuecomment-13440029.
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). Those of you who can't see list of wines...you may need to install mongodb...go here: http://docs.mongodb.org/manual/tutorial/install-mongodb-on-os-x/ (I use mac) and try the "Install from 10gen builds" unless you have Homebrew or MacPorts already installed. There are links to other OS at the top of that page.
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"
KittPhi Thanck you very mutch. I spent three days looking for a solution to the problem, and thanks to you I found it.