Skip to content

Instantly share code, notes, and snippets.

@jermsam
Created July 13, 2018 06:39
Show Gist options
  • Save jermsam/7bc9f3d11f036259d228f164f2bd94d3 to your computer and use it in GitHub Desktop.
Save jermsam/7bc9f3d11f036259d228f164f2bd94d3 to your computer and use it in GitHub Desktop.
Exposing the remote end to the react app
// src/feathers.js
import io from 'socket.io-client'
import feathers from '@feathersjs/client'
// Socket.io is exposed as the `io` global.
const socket = io('http://localhost:3030')
// @feathersjs/client is exposed as the `feathers` global.
const client = feathers()
.configure(feathers.socketio(socket))
//incase we later have to do authentication
.configure(
feathers.authentication({
storage:window.localStorage
})
)
export default client
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment