Composing Elixir Plugs in a Phoenix application
23 Mar 18Elixir is a functional language, so it’s no surprise that one of the main building blocks of the request-response cycle is the humble Plug. A Plug will take connection struct (see Plug.Conn) and return a new struct of the same type. It is this concept that allows you to join multiple plugs together, each with their own transformation on a Conn struct. A plug can be either a function or a module that implements the Plug behaviour.
http://www.jackmarchant.com/articles/composing-elixir-plugs-in-a-phoenix-application


















