server for the code-battle interactive game
Setup postgres as described in settings.py
.
$ python manage.py migrate
$ python manage.py runserver
[1] Get next random snippet: GET /snippets/next/
Response:
{
"status": "OK",
"snippet_id": 17,
"code": "print a\n\nprint b",
"time_so_solve": 5
}
[2] Submit state of a snippet from developer (websocket)
Request:
{
"snippet_id": 17,
"code": "print(a)\n\nprint(b)"
}
Response:
{
"status": "OK"
}
[3] Submit the fact that developer is finished (websocket)
Response:
{
"status": "OK",
"data": {
"result": "passed" | "failed"
}
}
or
{
"status": "error",
"errors": [<..>]
}