payservedb 1.0.0 → 1.0.2

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.js +2 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -3,7 +3,7 @@ const SMSAfricastalking = require('./src/models/sms_africastalking');
3
3
 
4
4
  // Maintain a record of open connections for each database
5
5
  const connections = {};
6
- const url = '127.0.0.1';
6
+ const url = '127.0.0.1:27017';
7
7
  const source = ''
8
8
 
9
9
  // Utility function to connect to MongoDB
@@ -11,7 +11,6 @@ async function connectToMongoDB(dbName) {
11
11
  try {
12
12
  const connectionString = `mongodb://${url}/${dbName}${source}`;
13
13
  await mongoose.connect(connectionString, {
14
- useNewUrlParser: true,
15
14
  useUnifiedTopology: true,
16
15
  });
17
16
  console.log('Connected to MongoDB');
@@ -42,6 +41,7 @@ async function switchDB(dbName) {
42
41
  }
43
42
  }
44
43
 
44
+
45
45
  // Importing all model files (Note: models may need to be re-registered for different connections)
46
46
  const models = {
47
47
  User: require('./src/models/user'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "payservedb",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"