-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
38 lines (27 loc) · 1.08 KB
/
app.py
File metadata and controls
38 lines (27 loc) · 1.08 KB
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
28
29
30
31
32
33
34
35
36
37
38
"""Aggregate FastAPI application exposing the frontend and research services."""
from __future__ import annotations
import os
from pathlib import Path
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from fastapi.staticfiles import StaticFiles
from frontend import main as frontend_main
from research.main import app as research_app
app = FastAPI(
title="Book Production Services",
description="Unified entrypoint for the frontend UI and research generator.",
version="1.0.0",
)
# -- Frontend -----------------------------------------------------------------
frontend_app = frontend_main.app
frontend_dir = Path(frontend_main.__file__).resolve().parent
# Serve frontend static files from the combined application.
app.mount(
"/static",
StaticFiles(directory=str(frontend_dir / "static")),
name="static",
)
# Include the frontend routes at the root of the combined application.
app.include_router(frontend_app.router)
# -- Research service ---------------------------------------------------------
app.include_router(research_app.router)