How to use the cote function in cote

To help you get started, we’ve selected a few cote 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 kalisio / feathers-distributed / src / index.js View on Github external
function initializeCote (app) {
  debug('Initializing cote with options', app.coteOptions)
  // Setup cote with options
  app.cote = makeCote(app.coteOptions)

  // This subscriber listen to an event each time a remote app service has been registered
  app.serviceSubscriber = new app.cote.Subscriber({
    name: 'feathers services subscriber',
    namespace: 'services',
    key: 'services',
    subscribesTo: ['application', 'service']
  }, app.coteOptions)
  debug('Services subscriber ready for app with uuid ' + app.uuid)
  // When a remote service is declared create the local proxy interface to it
  app.serviceSubscriber.on('service', serviceDescriptor => {
    registerService(app, serviceDescriptor)
  })
  // This publisher publishes an event each time a local app or service is registered
  app.servicePublisher = new app.cote.Publisher({
    name: 'feathers services publisher',

cote

A Node.js library for building zero-configuration microservices.

MIT
Latest version published 13 days ago

Package Health Score

74 / 100
Full package analysis