@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.
@@ -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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vulkano/core",
3
- "version": "1.5.0",
3
+ "version": "1.5.2",
4
4
  "description": "A MVC framework using Express 4",
5
5
  "license": "MIT",
6
6
  "author": "Vulkano Team",