A simple Django based app that provides an API written using Django Ninja to evaluate mathematical expressions. Provides the following URLs:
/api/docs
- API documentation + sandbox/api/calc
- the API endpoint
Usage examples:
- http://127.0.0.1:8000/api/calc?expression=2%2B2
{"result": 4}
- http://127.0.0.1:8000/api/calc?expression=10%2A2%2B100%2F5
{"result": 40.0}
You can play with the API via http://127.0.0.1:8000/api/docs
- Install Python
- Install poetry
$ poetry install
$ poetry run python manage.py runserver