ClojureRemote 17 — Feathers.js Client

flyboarder
degree9
Published in
1 min readFeb 9, 2017
ClojureRemote 17

This post is one of many, and will cover topics discussed at ClojureRemote.

Our feathers client is configured similarly to the server. In this case we are configuring socket.io on the client for real-time events.

Setting up an instance of the feathers client itself takes 5 lines of code. We also store instances of our services, think of these as the client perspective of each service. We follow this up with a few helper functions to extract data from the authentication response.

Finally we provide a few methods to handle basic authentication.

Our signup! function wraps the create event and provides the data to be stored in the user service.

The login! and auth! functions both call authenticate with different options, the former specifying a lookup with email and password. The second searching for an existing JWT.

Nothing special going on for logout!

Quick and easy, everything from here on out is Hoplon!

--

--