@amohamud23/notihub 1.0.133 → 1.0.135
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +17 -8
- package/dist/index.js +17 -8
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -475,14 +475,23 @@ var SubscriptionActivity_default = SubscriptionActivity;
|
|
|
475
475
|
|
|
476
476
|
// src/client/MongooseClient.ts
|
|
477
477
|
var import_mongoose23 = __toESM(require("mongoose"), 1);
|
|
478
|
-
var Connect = () =>
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
478
|
+
var Connect = () => {
|
|
479
|
+
const connectionStr = process.env.DB_CONNECTION_STRING;
|
|
480
|
+
const dbName = process.env.DB_NAME;
|
|
481
|
+
if (!connectionStr) {
|
|
482
|
+
console.error("No connection string provided!");
|
|
483
|
+
process.exit(1);
|
|
484
|
+
}
|
|
485
|
+
if (!dbName) {
|
|
486
|
+
console.error("No database name provided!");
|
|
487
|
+
process.exit(1);
|
|
488
|
+
}
|
|
489
|
+
return import_mongoose23.default.connect(connectionStr, { dbName }).then(() => {
|
|
490
|
+
console.log("Database Connected!");
|
|
491
|
+
}).catch((err) => {
|
|
492
|
+
console.error(`Error Connecting to the Database: ${err}`);
|
|
493
|
+
});
|
|
494
|
+
};
|
|
486
495
|
var MongooseClient_default = Connect;
|
|
487
496
|
|
|
488
497
|
// src/exceptions.ts
|
package/dist/index.js
CHANGED
|
@@ -425,14 +425,23 @@ var SubscriptionActivity_default = SubscriptionActivity;
|
|
|
425
425
|
|
|
426
426
|
// src/client/MongooseClient.ts
|
|
427
427
|
import mongoose3 from "mongoose";
|
|
428
|
-
var Connect = () =>
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
428
|
+
var Connect = () => {
|
|
429
|
+
const connectionStr = process.env.DB_CONNECTION_STRING;
|
|
430
|
+
const dbName = process.env.DB_NAME;
|
|
431
|
+
if (!connectionStr) {
|
|
432
|
+
console.error("No connection string provided!");
|
|
433
|
+
process.exit(1);
|
|
434
|
+
}
|
|
435
|
+
if (!dbName) {
|
|
436
|
+
console.error("No database name provided!");
|
|
437
|
+
process.exit(1);
|
|
438
|
+
}
|
|
439
|
+
return mongoose3.connect(connectionStr, { dbName }).then(() => {
|
|
440
|
+
console.log("Database Connected!");
|
|
441
|
+
}).catch((err) => {
|
|
442
|
+
console.error(`Error Connecting to the Database: ${err}`);
|
|
443
|
+
});
|
|
444
|
+
};
|
|
436
445
|
var MongooseClient_default = Connect;
|
|
437
446
|
|
|
438
447
|
// src/exceptions.ts
|