This repository includes a very simple Python Flask HTTP API, made for demonstration purposes only.
- Open this repository in Github Codespaces or VS Code with Remote Devcontainers extension.
- Open the Terminal and navigate to the
api
directory.
cd api
- Use uvicorn to run the FastAPI app:
uvicorn main:app --reload
- Click 'http://127.0.0.1:8000' in the terminal, which should open the website in a new tab.
- Append
/generate_name
to the end of the URL.
Since this project is designed to be deployed to Azure Functions, you can also use the local emulator from Azure Functions Core Tools to test the function locally.
- Open this repository in Github Codespaces or VS Code with Remote Devcontainers extension.
- Open the Terminal and make sure you're in the root folder (
simple-fastapi-azure-function
). - Run
func host start
- Click 'http://localhost:7071/{*route}' in the terminal, which should open the website in a new tab.
- Change the URL to navigate to either the API at
/generate_name
or the docs at/docs
.
Run azd up
.
Navigate to the endpoint displayed in the terminal.
To try API v1, append /generate_name
to the end of the URL.