ClojureRemote 17 — Feathers.js Server

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

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

Both our client and server components are going to be written in ClojureScript. This means compiling our app server for Node.js.

As you can see our server is very simple, the feathers.app namespace takes care of much of our work for us. Let’s walk through this a bit.

First we require the feathers.app namespace and any others we might need, these could contain other services or middleware for our application

Next we enable console printing so Node.js can spit things to our terminal.

To avoid garbage collection we are also going to store an instance of the default feathers application itself, as well as a reference to the public folder so we can use it for all our services.

Feathers has a built in configuration module, a quick 1-liner and we can include all that awesomeness.

Thanks to some threading sugar all our feathers features are configured nicely one after another, the order here does indeed matter so be careful!

Finally we have 2 little functions which set the entry-point for Node.js.

All in all, this is probably one of the easiest server setups ever.

--

--