This sample implements a complete Node.js application. Notable features:
- Typed usage of express for server side MVC
- Typed usage of mongodb for server side database
- Typed usage of Node.js
- Use of TypeScript module syntax
- Visual Studio project file for working with the project
Note: Perform steps 3 - 6 with your working directory set to the folder containing this README:
-
Install MongoDB if necessary (see http://docs.mongodb.org/manual/installation/ )
-
Run the following command to launch the MongoDB process:
<mongoinstalldir>\bin\mongod -
Restore the sample app data to MongoDB in another command prompt with the following command:
<mongoinstalldir>\bin\mongorestore dump -
Install the app's node dependencies with the following command:
npm install -
Compile the app with the following command:
tsc --sourcemap --module commonjs app.ts -
Launch the Node process to serve the app using the following command:
node app.js -
Open your favorite browser and going to the following URL to access the app:
http://localhost:3000/