Spaces:
Running
Running
File size: 774 Bytes
4987e1d b2716ae fa90d29 9719ebf 745d17c fa90d29 4987e1d fa90d29 4987e1d 745d17c fa90d29 4987e1d ca46819 d62c4c2 4987e1d d62c4c2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | # app.py
from fastapi import FastAPI
from fastapi.responses import HTMLResponse
from data import ensure_page_loaded
from ui import router as ui_router
from license_curation import router as lic_router
from commercial_stats import router as commercial_router
app = FastAPI()
@app.on_event("startup")
def _startup():
try:
ensure_page_loaded(0) # warm page 1 so "/" is instant
except Exception:
pass
# Optional welcome redirect
@app.get("/", response_class=HTMLResponse)
def root():
# Serve the catalog landing page (page 1) via ui router
return HTMLResponse("<script>location.href='/page/1'</script>")
# Include routers AFTER app is defined
app.include_router(ui_router)
app.include_router(lic_router)
app.include_router(commercial_router) |