common-rod 1.7.2 → 1.7.3
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/index.js +11 -4
- package/lib/validateConf.js +6 -0
- package/package.json +1 -1
- package/readme.md +11 -0
package/index.js
CHANGED
|
@@ -717,11 +717,17 @@ async function _connectMongodb(appRodSession, mongoConf){
|
|
|
717
717
|
strLog = "host=" + hosts;
|
|
718
718
|
connectionString = `mongodb://${auth}${hosts}/${mongoConf.db}`;
|
|
719
719
|
}else{
|
|
720
|
-
if(
|
|
721
|
-
|
|
720
|
+
if(mongoConf.SRV === true){
|
|
721
|
+
connectionString = `mongodb+srv://${auth}${mongoConf.ip}/${mongoConf.db}`;
|
|
722
|
+
strLog = `SRV ip=${mongoConf.ip} port=${mongoConf.port}`;
|
|
723
|
+
}else{
|
|
724
|
+
if(!mongoConf.port){
|
|
725
|
+
mongoConf.port = "27017";
|
|
726
|
+
}
|
|
727
|
+
connectionString = `mongodb://${auth}${mongoConf.ip}:${mongoConf.port}/${mongoConf.db}`;
|
|
728
|
+
strLog = `ip=${mongoConf.ip} port=${mongoConf.port}`;
|
|
722
729
|
}
|
|
723
|
-
|
|
724
|
-
strLog = `ip=${mongoConf.ip} port=${mongoConf.port}`;
|
|
730
|
+
|
|
725
731
|
}
|
|
726
732
|
|
|
727
733
|
let MongoClient = require('mongodb').MongoClient;
|
|
@@ -948,6 +954,7 @@ function handleErrorExpress(appRodSession, q) {
|
|
|
948
954
|
//ROUTE AT MATCH ( URL NOT FOUND DEFAULT)
|
|
949
955
|
app.use((req,res,next)=>{
|
|
950
956
|
q.dq(req);
|
|
957
|
+
appRodSession.info( `URL NOT FOUND :: method=${req.method} url=${req.url} `);
|
|
951
958
|
return res.status(403).send("URL NOT FOUND");
|
|
952
959
|
});
|
|
953
960
|
|
package/lib/validateConf.js
CHANGED
|
@@ -278,6 +278,12 @@ function validateConType(conn_type, path, obj, name){
|
|
|
278
278
|
"required_attr": false,
|
|
279
279
|
"required_val": false,
|
|
280
280
|
"type": "string"
|
|
281
|
+
},{
|
|
282
|
+
"config_path": `${path}.SRV`,
|
|
283
|
+
"array": false,
|
|
284
|
+
"required_attr": false,
|
|
285
|
+
"required_val": false,
|
|
286
|
+
"type": "boolean"
|
|
281
287
|
}
|
|
282
288
|
]
|
|
283
289
|
};
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
"user":"$user",
|
|
52
52
|
"pwd":"$pwd"
|
|
53
53
|
},
|
|
54
|
+
"SRV": false , //optional true/false, default = false
|
|
54
55
|
"max_retry": 0,
|
|
55
56
|
"timeout": 4,
|
|
56
57
|
"retry_condition": "CONNECTION_ERROR",
|
|
@@ -338,3 +339,13 @@ Fix bug hideCredenmtial with nested object
|
|
|
338
339
|
Fix bug hideCredenmtial with oher ctype
|
|
339
340
|
Fix DetailLog input response attribure Data
|
|
340
341
|
```
|
|
342
|
+
|
|
343
|
+
# [1.7.3] - 2023-06-15
|
|
344
|
+
### Added
|
|
345
|
+
```
|
|
346
|
+
- Support mongo connecion with SRV option
|
|
347
|
+
- Add applog "URL NOT FOUND"
|
|
348
|
+
```
|
|
349
|
+
### Changed
|
|
350
|
+
### Fixed
|
|
351
|
+
|