18 lines
585 B
Python
18 lines
585 B
Python
from pathlib import Path
|
|
|
|
from fastapi import FastAPI
|
|
from fastapi.staticfiles import StaticFiles
|
|
|
|
from routes.fetch import router as fetch_router
|
|
from routes.events import router as events_router
|
|
|
|
app = FastAPI()
|
|
|
|
app.include_router(fetch_router, prefix="/api")
|
|
app.include_router(events_router, prefix="/api")
|
|
|
|
# Serve a minimal frontend for browsing events. Use an absolute path so it
|
|
# works regardless of the working directory used to start uvicorn.
|
|
frontend_dir = Path(__file__).parent / "frontend"
|
|
app.mount("/", StaticFiles(directory=frontend_dir, html=True), name="frontend")
|