Skip to content
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

Open
adardesign opened this issue Feb 10, 2013 · 13 comments
Open

socket.io.js 404, what am i missing? #7

adardesign opened this issue Feb 10, 2013 · 13 comments

Comments

@adardesign
Copy link

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)

socket io

What am i doing wrong?

@toddp
Copy link

toddp commented Feb 10, 2013

did you run npm install first? package.json lists the dependencies of this app, and you should use npm to install them.

@adardesign
Copy link
Author

@toddp, yes i did!

@toddp
Copy link

toddp commented Feb 10, 2013

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'));
 });

@mf2226
Copy link

mf2226 commented Feb 11, 2013

I Have the same problem, any updates?

@toddp
Copy link

toddp commented Feb 12, 2013

I think the maintainer needs to look at this.

@markopolo123
Copy link

I too can't see the list of wines...
On Feb 12, 2013 4:12 PM, "Todd Pinkerton" notifications@github.com wrote:

I think the maintainer needs to look at this.


Reply to this email directly or view it on GitHubhttps://github.com//issues/7#issuecomment-13440029.

@noeliasfranco
Copy link

I can't see the list of wines too :(

@TonyLuo
Copy link

TonyLuo commented Apr 17, 2013

There is no data in collection wines, you need to call populateDB() once to insert records into it first

@TonyLuo
Copy link

TonyLuo commented Apr 17, 2013

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 .

@webdogz
Copy link

webdogz commented May 14, 2013

@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.

@vu0tran
Copy link

vu0tran commented Jan 28, 2014

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
Copy link

KittPhi commented Mar 26, 2020

<script src="node_modules\socket.io-client\dist\socket.io.js"></script>

@StarayYaga
Copy link

KittPhi
Thanck you very mutch. I spent three days looking for a solution to the problem, and thanks to you I found it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants