Created
October 10, 2018 17:50
-
-
Save andijakl/580c11ab4f24bbe1866979a639795504 to your computer and use it in GitHub Desktop.
Open a connection to the Cosmos DB database
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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