feat(config): load repo-root .env via python-dotenv
All checks were successful
python-syntax / syntax-check (push) Successful in 4s

This commit is contained in:
2026-04-05 20:05:11 +02:00
parent 683f2d5961
commit bb247aaad2
4 changed files with 15 additions and 0 deletions

9
.env.example Normal file
View File

@@ -0,0 +1,9 @@
# Copy to .env and adjust as needed
CLICKTHROUGH_HOST=127.0.0.1
CLICKTHROUGH_PORT=8123
CLICKTHROUGH_TOKEN=change-me
CLICKTHROUGH_DRY_RUN=false
CLICKTHROUGH_GRID_ROWS=12
CLICKTHROUGH_GRID_COLS=12
# CLICKTHROUGH_ALLOWED_REGION=0,0,1920,1080

View File

@@ -22,6 +22,8 @@ CLICKTHROUGH_TOKEN=change-me python -m server.app
Server defaults to `127.0.0.1:8123`.
`python-dotenv` is enabled, so values from a repo-root `.env` file are loaded automatically.
## Minimal API flow
1. `GET /screen` with grid

View File

@@ -1,5 +1,6 @@
fastapi>=0.115.0
uvicorn>=0.30.0
python-dotenv>=1.0.1
mss>=9.0.1
pillow>=10.4.0
pyautogui>=0.9.54

View File

@@ -5,10 +5,13 @@ import time
import uuid
from typing import Literal, Optional
from dotenv import load_dotenv
from fastapi import Depends, FastAPI, Header, HTTPException, Response
from pydantic import BaseModel, Field, model_validator
load_dotenv(dotenv_path=".env", override=False)
app = FastAPI(title="clickthrough", version="0.1.0")