Created
April 30, 2018 15:46
-
-
Save RubyRubenstahl/3691986e3957f44894815b3837bcaebd to your computer and use it in GitHub Desktop.
Feathers app issue sample code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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