29 lines
1.1 KiB
Python
29 lines
1.1 KiB
Python
from fastapi import FastAPI
|
|
from fastapi.middleware.cors import CORSMiddleware
|
|
|
|
from app.api import bills, members, follows, dashboard, search, settings, admin, health
|
|
from app.config import settings as config
|
|
|
|
app = FastAPI(
|
|
title="PocketVeto",
|
|
description="Monitor US Congressional activity with AI-powered bill summaries.",
|
|
version="1.0.0",
|
|
)
|
|
|
|
app.add_middleware(
|
|
CORSMiddleware,
|
|
allow_origins=[o for o in [config.LOCAL_URL, config.PUBLIC_URL] if o],
|
|
allow_credentials=True,
|
|
allow_methods=["*"],
|
|
allow_headers=["*"],
|
|
)
|
|
|
|
app.include_router(bills.router, prefix="/api/bills", tags=["bills"])
|
|
app.include_router(members.router, prefix="/api/members", tags=["members"])
|
|
app.include_router(follows.router, prefix="/api/follows", tags=["follows"])
|
|
app.include_router(dashboard.router, prefix="/api/dashboard", tags=["dashboard"])
|
|
app.include_router(search.router, prefix="/api/search", tags=["search"])
|
|
app.include_router(settings.router, prefix="/api/settings", tags=["settings"])
|
|
app.include_router(admin.router, prefix="/api/admin", tags=["admin"])
|
|
app.include_router(health.router, prefix="/api/health", tags=["health"])
|