Feathers: Socket.io transport

This commit is contained in:
Julien Le Coupanec 2018-02-10 03:24:42 +01:00
parent 1564a59aa2
commit 4e4d66405d
1 changed files with 14 additions and 0 deletions

View File

@ -210,8 +210,22 @@ app.use(express.errorHandler()) // set up the error handler with the default co
// --> SOCKET.IO <--
const feathers = require('@feathersjs/feathers');
const socketio = require('@feathersjs/socketio');
const app = feathers();
app.configure(socketio()); // sets up the Socket.io transport with the default configuration using either the server provided by app.listen or passed in app.setup(server)
app.configure(socketio(callback)) // sets up the Socket.io transport with the default configuration and call callback with the Socket.io server object
app.configure(socketio(options [, callback])) // sets up the Socket.io transport with the given Socket.io options object and optionally calls the callback
app.configure(socketio(port, [options], [callback])) // creates a new Socket.io server on a separate port. Options and a callback are optional
// The options can also be used to initialize uWebSocket which is a WebSocket server
// implementation that provides better performace and reduced latency.
// npm install uws --save
app.configure(socketio({
wsEngine: 'uws'
}));
// --> PRIMUS <--