827 B
827 B
Getting Started
Prerequisites
- Docker
- Python 3.7+
Installation
- Clone the repository
- Build the Docker image:
docker build -t fastapi-service .
- Run the container:
docker run -p 8000:8000 fastapi-service
Development
To set up a development environment:
- Create a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
- Run the application:
uvicorn main:app --reload
The API will be available at http://localhost:8000.
API Documentation
FastAPI provides automatic interactive API documentation. Once the server is running, you can access:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc