First look at FastAPI.
Setting up an API respository with tools that can be reused.
I use venv
python -m venv venv
Mac:
source venv/bin/activate
Windows:
TBC
pip install -r requirements.txt
Run the FastAPI app
in example.py
.
uvicorn example:app --reload
Check your python version and run example.py
with python command.
python example.py
Example of server running.
INFO: Started server process [1234]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
Enter route http://127.0.0.1:8000
in browser url.
You should see {"Helloo":"World"}
as the response.
Link https://fastapi.tiangolo.com/
GitHub https://github.com/tiangolo/fastapi
2022 Jeremy Tang