can-connect-feathers
Integrate can-connect with the FeathersJS Client
Object
can-connect-feathers
is a set of behaviors for integrating can-connect with Feathers Client.
- The service behavior connects to a Feathers service.
- The session behavior connects to the feathers-authentication-client methods on a Feathers Client instance.
Both of the included behaviors require a Feathers Client instance. Here is a basic setup:
// models/feathers.js
var feathers = require('feathers/client');
var socketio = require('feathers-socketio/client');
var io = require('socket.io-client/dist/socket.io');
var hooks = require('feathers-hooks');
var auth = require('feathers-authentication-client');
var socket = io('');
var feathersClient = feathers()
.configure(hooks())
.configure(socketio(socket))
.configure(auth());
module.exports = feathersClient;
Pro tip: If you are planning on using Done-SSR, exchange the
socket.io-client/dist/socket.io
module forsteal-socket.io
in the above example.