Skip to content

markmarijnissen/feathers-primus

 
 

Repository files navigation

feathers-primus

Build Status Code Climate Test Coverage Dependency Status Download Status

The Feathers Primus real-time API provider

About

This provider exposes Feathers services through Primus real-time APIs. It is compatible with Feathers 1.x and 2.x.

Note: For the full API documentation go to feathersjs.com/docs/providers.html.

Quick example

npm install ws

import feathers from 'feathers';
import primus from 'feathers-primus';

const app = feathers()
  .configure(primus({
    transformer: 'websockets'
  }, function(primus) {
    // Set up Primus authorization here
    primus.authorize(function (req, done) {
      req.feathers.data = 'Hello world';

      done();
    });
  }));

app.use('/todos', {
  get: function(id, params) {
    console.log(params.data); // -> 'Hello world'

    return Promise.resolve({
      id,
      description: `You have to do ${name}!`
    });
  }
});

License

Copyright (c) 2015

Licensed under the MIT license.

About

The Feathers Primus real-time API provider

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%