Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Azure-Samples/cosmos-db-nosql-nodejs-quickstart
Quickstart application template for Azure Cosmos DB for NoSQL and JavaScript
https://github.com/Azure-Samples/cosmos-db-nosql-nodejs-quickstart
azd-templates azure azure-dev cosmos-db javascript nodejs
Last synced: 3 months ago
JSON representation
Quickstart application template for Azure Cosmos DB for NoSQL and JavaScript
- Host: GitHub
- URL: https://github.com/Azure-Samples/cosmos-db-nosql-nodejs-quickstart
- Owner: Azure-Samples
- License: mit
- Created: 2023-12-13T17:11:50.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-18T14:27:47.000Z (3 months ago)
- Last Synced: 2024-10-19T13:28:02.689Z (3 months ago)
- Topics: azd-templates, azure, azure-dev, cosmos-db, javascript, nodejs
- Language: Bicep
- Homepage: https://learn.microsoft.com/azure/cosmos-db/nosql/quickstart-nodejs
- Size: 174 KB
- Stars: 3
- Watchers: 22
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
- Security: .github/SECURITY.md
Awesome Lists containing this project
README
---
page_type: sample
name: "Quickstart: Azure Cosmos DB for NoSQL and Azure SDK for Node.js"
description: This is a simple Express web application to illustrate common basic usage of Azure Cosmos DB for NoSQL and the Azure SDK for Node.js.
urlFragment: template
languages:
- typescript
- javascript
- azdeveloper
products:
- azure-cosmos-db
---# Quickstart: Azure Cosmos DB for NoSQL client library for Node.js
This is a simple Express web application to illustrate common basic usage of Azure Cosmos DB for NoSQL's client library for Node.js. This sample application accesses an existing account, database, and container using the [`@azure/cosmos`](https://www.npmjs.com/package/@azure/cosmos) and [`@azure/identity`](https://www.npmjs.com/package/@azure/identity) packages.
### Prerequisites
- [Docker](https://www.docker.com/)
- [Azure Developer CLI](https://aka.ms/azd-install)
- [Node.js 22 or newer](https://nodejs.org/)### Quickstart
1. Log in to Azure Developer CLI.
```bash
azd auth login
```> [!TIP]
> This is only required once per-install.1. Initialize this template (`cosmos-db-nosql-nodejs-quickstart`) using `azd init`
```bash
azd init --template cosmos-db-nosql-nodejs-quickstart
```1. Ensure that **Docker** is running in your environment.
1. Use `azd up` to provision your Azure infrastructure and deploy the web application to Azure.
```bash
azd up
```1. Observed the deployed web application
![Screenshot of the deployed web application.](assets/web.png)
1. (Optionally) Run this web application locally in either the `src/js` or `src/ts` folders:
```bash
npm install
npm run dev
```> [!IMPORTANT]
> When your Azure infrastructure is provisioned, the endpoint for your deployed Azure Cosmos DB for NoSQL account is automatically saved in the *.env* file for both the JavaScript and TypeScript local projects to make debugging easier.