How to use @feathersjs/transport-commons - 3 common examples

To help you get started, we’ve selected a few @feathersjs/transport-commons examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github feathersjs / feathers / packages / primus / lib / index.js View on Github external
primus.on('disconnection', spark => app.emit('disconnect', getParams(spark)));
          }

          if (typeof configurer === 'function') {
            debug('Calling Primus configuration function');
            configurer.call(this, this.primus);
          }

          resolve(this.primus);

          return this._super.apply(this, arguments);
        }
      }, app);
    });

    app.configure(commons({
      done,
      socketMap,
      getParams,
      emit: 'send'
    }));
  };
}
github feathersjs / feathers / packages / socketio / lib / index.js View on Github external
io.sockets.setMaxListeners(64);
          }

          if (typeof config === 'function') {
            debug('Calling SocketIO configuration function');
            config.call(this, this.io);
          }

          resolve(this.io);

          return this._super.apply(this, arguments);
        }
      }, app);
    });

    app.configure(commons({
      done,
      socketMap,
      getParams,
      emit: 'emit'
    }));
  };
}
github feathersjs / feathers / packages / http / src / index.js View on Github external
}

      return middie.use(location);
    }
  });

  Object.getOwnPropertyNames(feathersApp).forEach(prop => {
    const feathersProp = Object.getOwnPropertyDescriptor(feathersApp, prop);
    const serverProp = Object.getOwnPropertyDescriptor(server, prop);

    if (serverProp === undefined && feathersProp !== undefined) {
      Object.defineProperty(server, prop, feathersProp);
    }
  });

  server.configure(routing());
  server.configure(rest);

  return server;
}

@feathersjs/transport-commons

Shared functionality for websocket providers

MIT
Latest version published 22 days ago

Package Health Score

92 / 100
Full package analysis