This repo has a devcontainer environment making it easy to get started.
Configure your Azure Cosmos DB credentials as environment variables.
export COSMOS_ENDPOINT="<cosmos-account-URI>"
export COSMOS_KEY="<cosmos-account-PRIMARY-KEY>"
💡 TIP: If you don't have an Azure Cosmos DB account, create a free account.
Run the quickstart sample app using the mongodb
package from NPM.
cd 001-quickstart/
npm install mongodb
npm run start
If you change the code, run the linter.
cd ./
npm install eslint-config-standard --no-save
cd ./001-quickstart/
npx eslint .
If you use a self-signed certificate (emulator, Docker, etc.), you may need to disable Node's validation:
const client = new MongoClient(
...,
{ tlsAllowInvalidCertificates: true }
)