Rename project for AdCloud tracking and ad delivery

This commit is contained in:
2026-09-15 19:04:53 +08:00
parent fd30c83152
commit f418e92673
6 changed files with 12 additions and 10 deletions
View File
+29
View File
@@ -0,0 +1,29 @@
import os
from typing import Literal
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from pydantic import BaseModel
app = FastAPI(title="AdCloud Server", version="0.1.0")
app.add_middleware(
CORSMiddleware,
allow_origins=[
origin.strip()
for origin in os.getenv(
"CORS_ORIGINS", "http://localhost:3000,http://localhost:5173"
).split(",")
if origin.strip()
],
allow_methods=["GET"],
allow_headers=["*"],
)
class HealthResponse(BaseModel):
status: Literal["ok"] = "ok"
@app.get("/health", response_model=HealthResponse)
def health() -> HealthResponse:
return HealthResponse()