Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

polst/feathers-socketcluster

Open more actions menu

Repository files navigation

feathers-socketcluster

Build Status Code Climate Test Coverage Dependency Status Download Status Slack Status

The Feathers SocketCluster real-time API provider

About

This provider exposes Feathers services through a SocketCluster real-time API. It is compatible with Feathers 2.x (1.x not tested).

Tests not working.

Note: For the full API documentation go to http://docs.feathersjs.com/real-time/socket-io.html.

Note: Not working with feathers authentication as there is an event naming collision between that package and SC (authenticate)

Quick example on SC worker controller

import feathers from 'feathers';
import feathersSocket from 'feathers-socketcluster';
let scServer = worker.scServer;
let httpServer = worker.httpServer;
const app = feathers()
  .configure(feathersSocket({socketServer: scServer}, function(io) {
    
  }));

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

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

app.setup(httpServer);

Client use

import socketCluster from 'socketcluster-client';
import feathers from 'feathers/client';
import feathersSC from 'feathers-socketcluster/client';

const socket = socketCluster.connect({ port: 8000 });
const app = feathers()
  .configure(feathersSC(socket));

License

Copyright (c) 2017

Licensed under the MIT license.

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
Morty Proxy This is a proxified and sanitized view of the page, visit original site.