Web Server

The de-facto web server in Erlang is Cowboy for which a direct set of bindings is available in the Purerl package sets along with examples on how to use them.

This is good practise, to build direct bindings that are true (where possible) to underlying Erlang libraries/APIs and then build nicely typed Purerl on top of that. Building a whole application using these bindings directly however would be a bit burdensome and it is for this reason that I wrote Stetson which sits on top of Cowboy and exposes something a litle more Purerl specific.

Versioning is a case of ‘check what we’re linking to in the demo projects’, which at the moment is Cowboy 2.8.

  • Stetson: Intro to configuring Stetson as a web server
  • Routing: Building typed routes to fire off handlers
  • Rest: Writing restful handlers
  • Web sockets: Writing Websocket handlers
  • Streaming: Writing streaming (loop) handlers