Technical challenge of Jokes and Maths APIs.
- Clone repository.
git clone https://github.com/eduardotaipe/joke_api_sm.git
- Install dependencies.
cd joke_api_sm
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
- Run app.
uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
- Joke:
GET http://127.0.0.1:8000/api/v1/joke/
GET http://127.0.0.1:8000/api/v1/joke/{name_api}
POST http://127.0.0.1:8000/api/v1/joke/
PUT http://127.0.0.1:8000/api/v1/joke/{id}
DELETE http://127.0.0.1:8000/api/v1/joke/{id}
- Math:
http://127.0.0.1:8000/api/v1/math/lcm?numbers={comma_separated_integers}'
http://127.0.0.1:8000/api/v1/math/plus_one?number={integer}'
For the JokeAPI you can use the interactive api documentation from here.
For the MathAPI LCM(Lowest Common Multiple) Fastapi does not format the url correctly, use CURL or any other tool to test this endpoint.
curl -X 'GET' \
'http://127.0.0.1:8000/api/v1/math/lcm?numbers=15,30,2,4' \
-H 'accept: application/json'
- Run tests.
pytest