30 lines
813 B
Python
30 lines
813 B
Python
"""House ELO Ranking API."""
|
|
|
|
from fastapi import FastAPI
|
|
from fastapi.middleware.cors import CORSMiddleware
|
|
|
|
from app.routers import comparisons, images, listings, rankings
|
|
|
|
app = FastAPI(
|
|
title="House ELO Ranking",
|
|
description="Pairwise comparison and ELO ranking of Funda listings",
|
|
version="1.0.0",
|
|
)
|
|
|
|
app.add_middleware(
|
|
CORSMiddleware,
|
|
allow_origins=["*"],
|
|
allow_credentials=True,
|
|
allow_methods=["*"],
|
|
allow_headers=["*"],
|
|
)
|
|
|
|
app.include_router(comparisons.router, prefix="/api", tags=["comparisons"])
|
|
app.include_router(images.router, prefix="/api", tags=["images"])
|
|
app.include_router(listings.router, prefix="/api", tags=["listings"])
|
|
app.include_router(rankings.router, prefix="/api", tags=["rankings"])
|
|
|
|
|
|
@app.get("/api/health")
|
|
def health():
|
|
return {"status": "ok"} |