https://github.com/dineshba/coderacing
https://github.com/dineshba/coderacing
actor-model elixir
Last synced: 29 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/dineshba/coderacing
- Owner: dineshba
- Created: 2017-11-05T05:37:26.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-09-30T05:45:00.000Z (over 7 years ago)
- Last Synced: 2025-03-06T07:19:06.096Z (over 1 year ago)
- Topics: actor-model, elixir
- Language: Elixir
- Size: 349 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# CodeRacing
### To Play
* Register by `curl -X POST -d '{"user": {"name": "yourName"}}' -H "Content-Type:application/json" localhost:4000/register`
* You will get a secret_key in the above response. Use that for the successive requests
* To see the challenge for you(racer), `curl localhost:4000/challenge -H "username: yourName" -H "key: secret_key"`
* To get the random input from server, `curl localhost:4000/challenge/input -H "username: yourName" -H "key: secret_key"`
* To post your output, `curl -X POST -d '{"output": output_body_in_sample_response}' localhost:4000/challenge/output -H "username: yourName" -H "key: secret_key" -H "Content-Type: application/json"`
* **Note:** Inputs are random and time difference between input and output requests should be less than `2 seconds`
To start code racer in your local:
* Clone the repo
* Install elixir and erlang (refer version in .tool-versions file)
* Install dependencies with `mix deps.get`
* Start Phoenix endpoint with `mix phoenix.server`
Now you can visit [`localhost:4000`](http://localhost:4000) in your browser to see the progress of the race.