Skip to content

Commit 78bb485

Browse files
committed
Updating database scripts
1 parent 06fdee0 commit 78bb485

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

StoredProcedures/createSP.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
async function createSP(endpoint, key, databaseId, containerId, storedProcedureFile, includeTest) {
22
// Disable TLS certificate validation for the emulator
3-
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
3+
if(endpoint === "https://localhost:8081")
4+
{
5+
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
6+
}
47
const { CosmosClient } = require("@azure/cosmos");
58
const client = new CosmosClient({ endpoint, key});
69
const { database } = await client.databases.createIfNotExists({ id: databaseId });

Triggers/createTrigger.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
async function createTrigger(endpoint, key, databaseId, containerId, triggerFile, includeTest) {
22
// Disable TLS certificate validation for the emulator
3-
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
3+
if(endpoint === "https://localhost:8081")
4+
{
5+
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
6+
}
47
const { CosmosClient } = require("@azure/cosmos");
58
const client = new CosmosClient({ endpoint, key});
69
const { database } = await client.databases.createIfNotExists({ id: databaseId });

0 commit comments

Comments
 (0)