wkentdag/sup

Npm start crashes

Closed this issue · 3 comments

why do you do this "node ./bin/www"?
It seems to crash for both Sam and me.

I think It would be helpful to strip down this code and make it just do the bare minimum of running a web server that connects to the db. That way we can switch around the db and not have to write a whole new app.js.

Thoughts?

That's the default command that express creates. What's the error you're getting? Sure you're inside the server subdirectory and not the root level?
Sent from mobile

On Feb 27, 2015, at 1:03 PM, Scott Hurlow notifications@github.com wrote:

why do you do this "node ./bin/www"?
It seems to crash for both Sam and me.

I think It would be helpful to strip down this code and make it just do the bare minimum of running a web server that connects to the db. That way we can switch around the db and not have to write a whole new app.js.

Thoughts?


Reply to this email directly or view it on GitHub.

Oh did you create the app using the express init command? That makes sense. The error just says: "Error: failed to connect to [localhost:27017]". Not sure why because the script falls back to port 3000...

But I think we should stick to using express in the single app.js file and just run it with 'node app.js' instead of npm start. Just to make the webapp structure as simple as possible while we get the whole team up to speed. (But in the future I like the idea of using the whole npm start / test functionality)

Found the issue!
The command mongod --dbpath data/ wasn't running because I hadn't made the data directory first.
Not sure if this is the same error that Sam got, but all seems to be working now.