authentication - How do you require an api token in elixir? -
building basic api accepts posts on endpoint add data , display on dashboard. api require token posts permitted not sure how so... using sugar framework handle http requests.
you use route guards suppose:
post "/resource/:api_key" when api_key == @api_key, controller, :dostuff sugar still alpha, don't know if supports middleware yet or not. might better off using plug directly until sugar stabilizes.
Comments
Post a Comment