IndigoIago/GottaCatchThemAll — pull request #67 by SterlingVix (2014-09-04 08:48:02+00:00)
Title: Add MongoDB connection to server and router. Read comments.

There is a substantial server refactor here, with more to come, I'm afraid.

Server.js is a very small file now; it grabs a reference to the Express app created in router (where it belongs) and tells it to start listening to the designated port.

Router.js has some mostly testing routes set up, but the working MongoDB is crammed in the middle. It will be pulled out into its own file in the upcoming refactor.

NOTE: Mongo and the mongo daemon (mongod) are seriously tricky. If the database isn't shut down cleanly MongoDB puts a lock on the DB until it's repaired. I have instructions on how to do that - I think that process should be automated through Grunt ASAP.