Instantly share code, notes, and snippets.

Embed
What would you like to do?
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