@brimble/models 1.4.78 → 1.4.79

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.
Files changed (2) hide show
  1. package/index.ts +3 -2
  2. package/package.json +2 -2
package/index.ts CHANGED
@@ -49,7 +49,8 @@ import { log } from "@brimble/utils";
49
49
 
50
50
  // Connection to Mongo
51
51
  export const connectToMongo = async (
52
- config: mongoose.ConnectOptions & { host: string}
52
+ mongoUrl: string,
53
+ config?: mongoose.ConnectOptions
53
54
  ): Promise<void> => {
54
55
  const options: mongoose.ConnectOptions = {
55
56
  useNewUrlParser: true,
@@ -67,7 +68,7 @@ export const connectToMongo = async (
67
68
  mongoose.set("useCreateIndex", true);
68
69
 
69
70
  // connect to mongo
70
- mongoose.connect(`mongodb+srv://${config.host}/?authMechanism=MONGODB-X509&authSource=%24external&tls=true&tlsCertificateKeyFile=${config.sslCert}`, options).catch((err) => {
71
+ mongoose.connect(mongoUrl, options).catch((err) => {
71
72
  log.error(`Unable to connect to mongo db, ${err}`)
72
73
  });
73
74
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brimble/models",
3
- "version": "1.4.78",
3
+ "version": "1.4.79",
4
4
  "description": "Brimble models",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -21,5 +21,5 @@
21
21
  "ts-node": "^8.10.2",
22
22
  "typescript": "^4.9.4"
23
23
  },
24
- "gitHead": "51b26cb5f0e96321c047c9ba4e8690bfd8f712f8"
24
+ "gitHead": "abee06cf597165cc50cceb23054914eff48607ec"
25
25
  }