I am aware of Plug, Phoenix, maru and many other approaches… I was wondering which one would suit better an api that is meant to work with json (thus perhaps, if possible, would be good to have data conversion integrated), and whether a solution containing extra stuff I might not need like Phoenix would be a good pick over just a simpler one.
For note, Phoenix is just built on plugs, it adds more plugs to use and it is nice to contain just because of that (plus it has a fantastic json templating system via poison), and parts you do not use you do not pay for, so you can make it very simple. I’d say use Phoenix.
I’ve not used the others though so I cannot comment on them. But don’t say ‘over just a simpler one’ because Phoenix is actually really really simple, both in terms of code and usage (plus it is blazing fast).
Use Phoenix to route requests to controllers. Render resources using the appropriate View modules. Authenticate your API access using a simple authentication token parameter, and use a Plug to authenticate and set the conn.assigns.current_user.