To start your Phoenix server:
mix deps.get
mix phx.server
or inside IEx with iex -S mix phx.server
Now you can visit localhost:4000
from your browser.
Ready to run in production? Please check our deployment guides.
A financial api where it is possible to add remove credits and with specific endpoints for use. When I received the problem, I didn't really know what I could use or how I could solve it. In that I remembered that I was studying about blockchains and had also read some Erlang Org Articles, that both Erlang and Elixir could solve these problems. I sought to study Elixir in parallel despite knowing the syntax of Elixir/Erlang theory and practice are different things and I needed both in this implementation. I ask for your patience in finding errors. I ask you to report it in ISSUES.
--
POST /reset
200 OK
--
GET /balance?account_id=1234
404 0
--
POST /event {"type":"deposit", "destination":"100", "amount":10}
201 {"destination": {"id":"100", "balance":10}}
--
POST /event {"type":"deposit", "destination":"100", "amount":10}
201 {"destination": {"id":"100", "balance":20}}
--
GET /balance?account_id=100
200 20
--
POST /event {"type":"withdraw", "origin":"200", "amount":10}
404 0
--
POST /event {"type":"withdraw", "origin":"100", "amount":5}
201 {"origin": {"id":"100", "balance":15}}
--
POST /event {"type":"transfer", "origin":"100", "amount":15, "destination":"300"}
201 {"origin": {"id":"100", "balance":0}, "destination": {"id":"300", "balance":15}}
--
POST /event {"type":"transfer", "origin":"200", "amount":15, "destination":"300"}
404 0