This project is a template for FastAPI projects.
- RESTful API: Exposes RESTful API endpoints
- Configuration: The repository includes a
.env
file that defines configurable environment variables.
Available versions:
latest
: Provides the latest version of the application
Download the executable from GitHub Releases.
Choose your preferred distribution:
-
Windows Executable:
- Windows 10 or later
-
Docker Images:
-
Run the following command to start the API server:
docker run -d -p 8000:8000 \ -e LOG_LEVEL=INFO \ -e FASTAPI_HOST=0.0.0.0 \ -e FASTAPI_PORT=8000 \ ggwozdz/{{{PROJECT-NAME}}}:latest
-
Create a
docker-compose.yml
file with the following content and rundocker-compose up
:services: api: image: ggwozdz/{{{PROJECT-NAME}}}:latest environment: - LOG_LEVEL=INFO - FASTAPI_HOST=0.0.0.0 - FASTAPI_PORT=8000 ports: - "8000:8000"
- Download from GitHub Releases
- Run
{{{PROJECT-NAME}}}.exe
-
Request:
curl -X GET "http://localhost:8000/healthcheck"
-
Response:
{ "status": "OK" }
The application uses a .env
file or Docker Compose to define configurable environment variables. Below are the available configuration options:
LOG_LEVEL
: The logging level for the application. Supported levels areNOTSET
,DEBUG
,INFO
,WARN
,WARNING
,ERROR
,FATAL
, andCRITICAL
. The same log level will be applied touvicorn
anduvicorn.access
loggers. Default isINFO
.FASTAPI_HOST
: Host for the FastAPI server. Default is127.0.0.1
.FASTAPI_PORT
: Port for the FastAPI server. Default is8000
.
Developer guide is available in docs/DEVELOPER.md.