50 lines
1.5 KiB
Python
50 lines
1.5 KiB
Python
"""
|
|
web/app.py
|
|
----------
|
|
FastAPI entrypoint for the Adobe Sign → DocuSign Migrator web app.
|
|
|
|
Run with:
|
|
uvicorn web.app:app --reload --port 8000
|
|
|
|
From the project root.
|
|
"""
|
|
|
|
from fastapi import FastAPI
|
|
from fastapi.staticfiles import StaticFiles
|
|
from fastapi.responses import FileResponse
|
|
import os
|
|
|
|
from web.config import settings
|
|
from web.routers import auth, templates, migrate, verify, audit
|
|
|
|
app = FastAPI(
|
|
title="Adobe Sign → DocuSign Migrator",
|
|
version=settings.version,
|
|
docs_url="/api/docs",
|
|
)
|
|
|
|
# Routers
|
|
app.include_router(auth.router, prefix="/api/auth", tags=["auth"])
|
|
app.include_router(templates.router, prefix="/api/templates", tags=["templates"])
|
|
app.include_router(migrate.router, prefix="/api/migrate", tags=["migrate"])
|
|
app.include_router(verify.router, prefix="/api/verify", tags=["verify"])
|
|
app.include_router(audit.router, prefix="/api/audit", tags=["audit"])
|
|
|
|
# Static files (frontend)
|
|
_static_dir = os.path.join(os.path.dirname(__file__), "static")
|
|
if os.path.isdir(_static_dir):
|
|
app.mount("/static", StaticFiles(directory=_static_dir), name="static")
|
|
|
|
|
|
@app.get("/health", tags=["health"])
|
|
def health():
|
|
return {"status": "ok", "version": settings.version}
|
|
|
|
|
|
@app.get("/", include_in_schema=False)
|
|
def index():
|
|
index_path = os.path.join(_static_dir, "index.html")
|
|
if os.path.exists(index_path):
|
|
return FileResponse(index_path)
|
|
return {"message": "Adobe Sign → DocuSign Migrator API", "docs": "/api/docs"}
|