A simple application with 2 endpoints on it's behalf.
- GET ->
/health
: An endpoint for a base healthcheck - GET ->
/info
: An endpoint printing a message - POST ->
/ping
: An endpoint taking body{"url": url}
, pinging it (GET request) and returnig the original body. - GET ->
/docs
: A Swagger based endpoints documentation - GET ->
/redoc
: A ReDoc based endpoints documentation
All necessary commands can be ran using make.
make install
- install app and it's dependenciesmake start
- start application using uvicorn. Usectrl+c
to stopmake start-gunicorn
- start application using guvicorn, using 4 workers. Usectrl+c
to stopmake build-docker-image
- build an image for a dockerized execution. This one is a pre-requisite for all other docker based commandsmake start-docker
- start a dockerized instance. Usermake stop-docker
to stopmake stop-docker
- stop a dockerized instancemake show-docker-logs
- scroll logs for a running instance. Eg. for debugging. Usectrl+c
to stopmake terminate-docker
- a hard wat to stop a dockerized instance
All tests can be ran using make.
Unit tests:
unit-test
: unit tests using pytest with local changesunit-test-docker
: unit tests on built docker imageunit-test-docker-locally
: unit tests on built docker image with local code changes
Api tests:
api-test
: api tests usin pytest pytest with local changesapi-test-docker
: api tests on built docker imageapi-test-docker-locally
: api tests on built docker image with local code changes
Swagger based docs are exposed via /docs
or /redoc
endpoint