Pure Python implementation of the backend of write-math
$ sudo docker run -t -p 8080:5000 --name writemath_api themoosemind/write-math-api
where 80 is the target port on the host system and 5000 is the port in the container.
Stop and remove all containers:
$ docker stop $(docker ps -a -q)
$ docker rm $(docker ps -a -q)
- Flask
- Werkzeug routing
- Jinja2 templating
- MySQL database
The payload has to be send as JSON. The server always returns JSON.
POST /api/recording
: Submit data of a recording- Payload:
{'recording': [[{x: 12, y: 4, t: 0}, ...], ...], 'recording_id': None}
- Returns:
- 200: The recording as it is in the database (inclusive recording_id)
- 400:
{'error': 'Invalid recording'}
- Payload:
GET /api/classification/<int:recording_id>
- Returns:
- 200: The recording as it is in the database
- 400:
{'error': 'Invalid recording'}
- Returns:
POST /api/users
: Create a new userPOST /api/users/login