trying to use fastapi
$ git clone https://github.com/siruku6/fastapi_sample.git
$ cd fastapi_sample
$ poetry install$ docker-compose build
$ docker-compose up* Installing new package with poetry, you have to rerun docker-compose build because the packages in container are installed while building that conatainer.
$ python main.py
# or
$ uvicorn main:app --reload --host 0.0.0.0You can access FastAPI Swagger UI with your browser. And also running following commands can show you the behvaiour of API.
# Test
$ curl localhost:8000
# Other trial
$ curl -X POST http://localhost:8000/2/
{"message":"Received time taking job."}
$ curl -X GET http://localhost:8000/2/
{"message":"2は実行中です"}
$ curl -X DELETE http://localhost:8000/2/
{"message":"2の中止処理を受け付けました"}Please run following commands before commit and push,
and fix all lines pointed out by them!
$ pflake8
$ mypy .