Developing a Node.js console app using DocumentDB
This sample shows you how to use the Microsoft Azure DocumentDB service to store and access data from a Node.js console application.
Running this sample
Before you can run this sample, you must have the following perquisites:
Clone this repository, or download the zip file.
Retrieve the URI and PRIMARY KEY (or SECONDARY KEY) values from the Keys blade of your DocumentDB account in the Azure Preview portal. For more information on obtaining endpoint & keys for your DocumentDB account refer to How to manage a DocumentDB account.
If you don't have an account, see Create a DocumentDB database account to set one up.
In the config.js file, located in the src folder, find config.endpoint and config.authKey and replace the placeholder values with the values obtained for your account.
config.endpoint = "~your DocumentDB endpoint here~";
config.authKey = "~your auth key here~";
Run npm install in a terminal to install required npm modules
Run node app.js in a terminal to start your start your node application.
About the code
The code included in this sample is intended to get you quickly started with a Node.js console application that connects to Azure DocumentDB.