Skip to content

Files

30 lines (21 loc) · 675 Bytes

README.md

File metadata and controls

30 lines (21 loc) · 675 Bytes

hello-fastapi

Hello FastAPI is a tiny web server that responds to a GET request with a JSON response.

It exposes the following endpoints:

  • /api - returns a JSON response with a message "Hello, FastAPI!", env vars starting with HELLO_ and request headers.
  • /docs - FastAPI's auto-generated API documentation.
  • /openapi.json - FastAPI's auto-generated OpenAPI schema.

Setup

python3 -m venv .venv
source ./.venv/bin/activate
pip install -r requirements.txt

Run via uvicorn cli:

uvicorn main:app --port 5001 --reload

Bulild and run via docker:

docker build -t hello-fastapi .
docker run --rm -p 5001:8000 hello-fastapi