28 lines
520 B
Python
28 lines
520 B
Python
from fastapi import FastAPI
|
|
from fastapi.middleware.cors import CORSMiddleware
|
|
|
|
from .dependencies import load_animeguess_anime_list
|
|
|
|
from .routers import animeguess
|
|
|
|
# Load anime list
|
|
load_animeguess_anime_list()
|
|
|
|
app = FastAPI()
|
|
|
|
# Middleware CORS
|
|
app.add_middleware(
|
|
CORSMiddleware,
|
|
allow_origins=["*"],
|
|
allow_credentials=True,
|
|
allow_methods=["*"],
|
|
allow_headers=["*"]
|
|
)
|
|
|
|
# Routes
|
|
app.include_router(animeguess.router)
|
|
|
|
# Health check
|
|
@app.get("/ping")
|
|
async def ping():
|
|
return {"Ping":"Pong"} |