Quick Setup - pcimino/nodejs-restify-mongodb GitHub Wiki

Quick Setup

If you're new to Node.js and/or Mongo DB, these steps will get you started. Advanced users may want to look at the start-node.bat script and configure it for their environment. *nix shell scripts are also included, run chmod 755 *.sh if needed.

  1. Download/clone this project
  2. Install MongoDB.
  3. Install and setup Nodejs
    3.1 Install Node.js.
    3.2 Setup dependencies for some of the Node modules: Installing Python & C++ Libraries
  4. Setup an environment variable MONGODB pointing to the install directory, if you want to use the included scripts.
  5. Run the create-db.bat/.sh which creates a directory structure for the test database.
  6. Run the install-modules.bat/.sh to install the required Node.js modules.
  7. Start the Mongo database: start-mongo.bat/.sh
  8. Start the Node.js server: start-node.bat/.sh
  9. Point your browser to http://localhost:3000

Node NPM Issues

This project uses node-gyp, so check the node-gyp README for prerequisites.

Demo Project

Once you get everything running, navigate to http://localhost:3000 and you'll see an intro page that goves you the choice of the HTML site or the Enyo site.

The HTML is very raw, but allows you to see the source and exactly how the API is used.

The Enyo is a minified version of this project. Demonstrating Enyo MVC.

Stopping the Database

The stop-mongo.bat/.sh scripts shutdown the database server in an orderly fashion. Interrupting the process can lock and even corrupt the database. For this demo you can always delete the lock file and the contents of %MONGODB%\data\db ($MONGODB/data/db) but it is recommened to simply shut things down properly.

Unit Testing

Return Home