forked from acmeair/acmeair
-
Notifications
You must be signed in to change notification settings - Fork 28
NodeJS To MongoDB Setup
aspyker edited this page May 30, 2013
·
1 revision
NodeJS v0.10.X
- Download link: http://nodejs.org/download/
- Install and ensure the node and npm executables are added to your path
MongoDB 2.4.X
- Download link: http://www.mongodb.org/downloads
- Unzip the zip into some directory
- For the rest of these instructions we will assume this to be the MONGO_SERVERDIR
cd \work\java
unzip mongodb-win32-x86_64-2.4.3.zip
cd \work\java\mongodb-win32-x86_64-2.4.3
set MONGO_SERVERDIR=C:\work\java\mongodb-win32-x86_64-2.4.3
- Git for access to the source code (http://msysgit.github.io/ for windows)
- Ensure git.exe is in your path
- Go into a directory that you want to have the code in and use git to clone it
cd \work\eclipse
git clone https://github.com/acmeair/acmeair.git
- For the rest of these instructions we will assume this to be the ACMEAIR_SRCDIR
set ACMEAIR_SRCDIR=C:\work\eclipse\acmeair
cd %ACMEAIR_SRCDIR%\acmeair-webapp-nodejs
npm update
- In another window, create a data directory and start mongod with that path
- Ensure that you have set node and npm in the path as before
cd %MONGO_SERVERDIR%
mkdir data
bin\mongod -dbpath data
- We do this by running a Acme Air loader program
cd %ACMEAIR_SRCDIR%\acmeair-webapp-nodejs\loader
node loader
- You should see output that indicates flights and customers (200) were loaded
cd %ACMEAIR_SRCDIR%\acmeair-webapp-nodejs
node app
- Load the following url:
http://localhost:3000/
- Login (use the provided credentials), search for flights (suggest today between Paris and New York), book the flights, use the checkin link to cancel the bookings one at a time, view your account profile
- Tell eclipse to import existing projects into the workspace looking in %ACMEAIR_SRCDIR%