@vulkano/core 1.5.0 → 1.5.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.
- package/bootstrap/server.js +10 -2
- package/package.json +1 -1
package/bootstrap/server.js
CHANGED
|
@@ -468,7 +468,8 @@ module.exports = function loadServer() {
|
|
|
468
468
|
}
|
|
469
469
|
|
|
470
470
|
const {
|
|
471
|
-
config: socketsConfig
|
|
471
|
+
config: socketsConfig,
|
|
472
|
+
middlewares: socketsMiddlewares
|
|
472
473
|
} = sockets;
|
|
473
474
|
|
|
474
475
|
const socketProps = {
|
|
@@ -573,7 +574,7 @@ module.exports = function loadServer() {
|
|
|
573
574
|
socketsDatabase = mongoose.connection.db.s.namespace.db;
|
|
574
575
|
|
|
575
576
|
// SOCKETS_MONGO_URI
|
|
576
|
-
if (socketsConnection !== mongoClientDB.s.url) {
|
|
577
|
+
if (socketsConnection && ( socketsConnection !== mongoClientDB.s.url )) {
|
|
577
578
|
|
|
578
579
|
const socketMongoInstance = new socketMongoose.Mongoose();
|
|
579
580
|
|
|
@@ -687,6 +688,13 @@ module.exports = function loadServer() {
|
|
|
687
688
|
io.use(sockets.middleware);
|
|
688
689
|
}
|
|
689
690
|
|
|
691
|
+
Object.keys(socketsMiddlewares || {}).forEach( (item) => {
|
|
692
|
+
const middlewareFunction = socketsMiddlewares[item];
|
|
693
|
+
if (typeof middlewareFunction === 'function') {
|
|
694
|
+
io.use(middlewareFunction);
|
|
695
|
+
}
|
|
696
|
+
});
|
|
697
|
+
|
|
690
698
|
// override vulkano
|
|
691
699
|
app.vulkano = vulkano;
|
|
692
700
|
|