nexus-backend 1.0.9 → 1.1.1

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.mjs CHANGED
@@ -10338,15 +10338,16 @@ var requiredEnv = (value, key) => {
10338
10338
  // src/config/mongoConfig.ts
10339
10339
  import mongoose from "mongoose";
10340
10340
  var connectMongoDb = async (config) => {
10341
- const { subDomain, userName, password, cluster, dbName } = config;
10342
- const srvURL = `mongodb+srv://${userName}:${password}@${cluster.toLowerCase()}.${subDomain}.mongodb.net/${dbName}?retryWrites=true&w=majority&appName=${cluster.toLowerCase()}`;
10341
+ const { subDomain, userName, password, cluster, dbName, shards, replicaSet } = config;
10342
+ const hosts = shards.map((s) => `${s}.${subDomain}.mongodb.net:27017`).join(",");
10343
+ const uri = `mongodb://${userName}:${password}@${hosts}/${dbName}?ssl=true&replicaSet=${replicaSet}&authSource=admin&appName=${cluster}`;
10343
10344
  try {
10344
- console.log("Trying +srv connection...");
10345
- await mongoose.connect(srvURL);
10345
+ console.log("Connecting to MongoDB...");
10346
+ await mongoose.connect(uri);
10346
10347
  console.log("Connected to MongoDB Atlas");
10347
10348
  return true;
10348
10349
  } catch (err) {
10349
- console.error("+srv connection failed:", err.message);
10350
+ console.error("Connection failed:", err.message);
10350
10351
  return false;
10351
10352
  }
10352
10353
  };
@@ -10549,7 +10550,7 @@ var Mailer = class {
10549
10550
  from: `${this.config.brandName} <${this.config.fromEmail}>`,
10550
10551
  to: [to],
10551
10552
  subject,
10552
- html: body
10553
+ react: body
10553
10554
  // or 'text: body' depending on your needs
10554
10555
  });
10555
10556
  console.log("SMTP Response:", response);