This repository contains a simple Magic8ball Phoenix app, which uses the Magic 8ball API.
This code is used to highlight elements of building APIs with Elixir using Plug as part of an Elixir talk given to the Triangle Elixir meetup.
- Install the dependencies
mix deps.get
- Start the Phoenix server
iex -S mix phoenix.server
- Open the app in your browser
- Call the Magic8ball shake api to test it:
curl -H 'Content-Type: application/json' "localhost:4000/magic8ball/api/shake"
{"answer":"My sources say no"}%