Skip to content

Instantly share code, notes, and snippets.

@andijakl
Created October 10, 2018 17:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andijakl/580c11ab4f24bbe1866979a639795504 to your computer and use it in GitHub Desktop.
Save andijakl/580c11ab4f24bbe1866979a639795504 to your computer and use it in GitHub Desktop.
Open a connection to the Cosmos DB database
try {
// Open a reference to the database
const dbResponse = await cosmosClient.databases.createIfNotExists({
id: databaseId
});
var database = dbResponse.database;
// ... (we will add more code here!)
res.send("Finished");
} catch (error) {
console.log(error);
res.status(500).send("Error with database query: " + error.body);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment