Git Product home page Git Product logo

documentdb-node-todo-app's Introduction

services platforms author
cosmos-db
nodejs
ryancrawcour

Web application development with Node.js and Express using Azure Cosmos DB

This sample shows you how to use the Azure Cosmos DB service to store and access data from a Node.js Express application hosted on Azure Websites.

My ToDo List Node.js application

For a complete end-to-end walk-through of creating this application, please refer to the full tutorial on the Azure documentation page

Running this sample

  1. Before you can run this sample, you must have the following perquisites:

  2. Clone this repository, or download the zip file.

  3. Retrieve the URI and PRIMARY KEY (or SECONDARY KEY) values from the Keys blade of your Azure Cosmos DB account in the Azure portal. For more information on obtaining endpoint & keys for your Azure Cosmos DB account refer to How to manage an Azure Cosmos DB account.

    If you don't have an account, see Create an Azure Cosmos DB database account to set one up.

  4. In the config.js file, located in the src folder, find config.host and config.authKey and replace the placeholder values with the values obtained for your account.

  5. Install the dependencies by opening a terminal, navigating to the directory in which the sample was installed, and running npm install.

  6. In the terminal, run npm start to start your start your node application.

  7. Launch a browser and navigate to http://127.0.0.1:3000/ My ToDo List Node.js application

Deploy this sample to Azure

  1. If you haven't already, enable a git repository for your Azure Website. You can find instructions on how to do this here.

  2. Add your Azure Website as a git remote.

     git remote add azure https://[email protected]:443/your-website.git
    
  3. Deploy by pushing to the remote.

     git push azure master
    
  4. In a few seconds, git will finish publishing your web application and launch a browser where you can see your handy work running in Azure!

About the code

The code included in this sample is intended to get you going with a simple Node.js Express application that connects to Azure Cosmos DB with the express intent of demonstrating how to interact with Azure Cosmos DB using the documentdb npm package. It is not intended to be a set of best practices on how to build scalable enterprise grade web applications. This is beyond the scope of this quick start sample.

More information

documentdb-node-todo-app's People

Contributors

acomsmpbot avatar aliuy avatar burkeholland avatar mimig1 avatar moderakh avatar ryancrawcour avatar snehagunda avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.