Added separate docker compose for local testing

This commit is contained in:
2026-02-11 00:30:40 +08:00
parent bb8ba326ff
commit 76ed0d2063
3 changed files with 50 additions and 29 deletions

View File

@@ -1,5 +1,5 @@
from fastapi import FastAPI, Request
# from fastapi.middleware.cors import CORSMiddleware
from fastapi.middleware.cors import CORSMiddleware
from slowapi import _rate_limit_exceeded_handler
from slowapi.errors import RateLimitExceeded
@@ -46,7 +46,16 @@ def create_application() -> FastAPI:
logger.info(f"DEBUG: Status Code: {response.status_code}")
return response
# Set up Rate Limiter (CORS is handled by Caddy at the edge)
# Set up fully permissive CORS for standalone/tunnelling mode
application.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
# Set up Rate Limiter
application.state.limiter = limiter
@application.exception_handler(RateLimitExceeded)