Skip to content

Instantly share code, notes, and snippets.

@RubyRubenstahl
Created April 30, 2018 15:46
Show Gist options
  • Save RubyRubenstahl/3691986e3957f44894815b3837bcaebd to your computer and use it in GitHub Desktop.
Save RubyRubenstahl/3691986e3957f44894815b3837bcaebd to your computer and use it in GitHub Desktop.
Feathers app issue sample code
import feathers from '@feathersjs/feathers';
import socketio from '@feathersjs/socketio-client';
import io from 'socket.io-client';
const socket = io('http://127.0.0.1:3030');
const app = feathers();
export default app;
// Set up Socket.io client with the socket
app.configure(socketio(socket));
const attachSessionId = context => {
return context;
};
app.service('messages').hooks({
before(context) {
console.log('before all hook ran');
}
});
// Receive real-time events through Socket.io
app.service('messages')
.on('created', message => console.log('New message created', message));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment