initial wip

This commit is contained in:
Bernhard Radermacher
2025-08-28 16:01:44 +00:00
parent d318f650a2
commit 4e9fd3d394
13 changed files with 216 additions and 0 deletions

33
main.py Normal file
View File

@@ -0,0 +1,33 @@
import datetime
from contextlib import asynccontextmanager
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from src.populate import populate
import src.routers as routers
@asynccontextmanager
async def lifespan(app: FastAPI):
populate()
yield
updated = datetime.datetime.now(tz=datetime.timezone.utc)
app = FastAPI(lifespan=lifespan)
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
app.include_router(routers.status)
#
# @app.get("/info/updated", tags=["info"])
# async def get_timestamp_of_last_update():
# """Timestamp of last update (YYYY-MM-DD HH:MM:SS UTC)."""
# return updated.strftime("%Y-%m-%d %H:%M:%S")