replace fastapi-analytics with posthog

This commit is contained in:
cyclotruc 2025-02-10 07:44:33 +00:00
parent edae3cc04b
commit e86032e38e
3 changed files with 7 additions and 6 deletions

View file

@ -3,7 +3,6 @@
import os
from pathlib import Path
from api_analytics.fastapi import Analytics
from dotenv import load_dotenv
from fastapi import FastAPI, Request
from fastapi.responses import FileResponse, HTMLResponse
@ -31,10 +30,6 @@ static_dir = Path(__file__).parent.parent / "static"
app.mount("/static", StaticFiles(directory=static_dir), name="static")
# Set up API analytics middleware if an API key is provided
if app_analytics_key := os.getenv("API_ANALYTICS_KEY"):
app.add_middleware(Analytics, api_key=app_analytics_key)
# Fetch allowed hosts from the environment or use the default values
allowed_hosts = os.getenv("ALLOWED_HOSTS")
if allowed_hosts: