A basic FastAPI project with one controller.
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txtuvicorn main:app --reloadThe API will be available at http://localhost:8000
- Swagger UI:
http://localhost:8000/docs - ReDoc:
http://localhost:8000/redoc
GET /- Welcome messageGET /health- Health check
GET /items/- List all itemsGET /items/{item_id}- Get a specific itemPOST /items/- Create a new itemPUT /items/{item_id}- Update an itemDELETE /items/{item_id}- Delete an item