This is the simplest api one can think of, but can be used to make one specific for you application.
Create conda environment with dependencies:
> conda env create -f environment.yml
> conda activate fast_api_app
Launch app:
> uvicorn main:app --reload
In a seperate terminal:
> python sample_request.py
Modify:
> autopep8 --in-place --aggressive --aggressive [script_name].py
Connecting to Heroku, create an app with a specific name and to specify it as Python app:
> heroku create [name-of-app] --buildpack heroku/python
Create another remote on Heroku:
> heroku git:remote --app [name-of-app]
Optionally, check if the remote is there:
> git remote -v
Lauch the app:
> git push heroku main
Now we can check out the app at https://[name-of-app].herokuapp.com/
Optionally, enter into the Heroku VM using:
> heroku run bash --app [name-of-app]
Run tests:
> pytest