Liberator allows you to define a “resource,” which is a controller Plug that follows the HTTP spec. It executes a complex decision graph in order to serve the right response, and you can override any decision in order to implement your exact endpoint. You can even override the decision graph itself, which can help simplify complex conditional logic in your app.
This is an Elixir port of a Clojure library by the same name. That’s a great library and I’d recommend checking it out if you use Clojure.