added ZstdMiddleware to ebook_search
treefmt / nix fmt (pull_request) Successful in 11s
pytest / pytest (pull_request) Successful in 36s
build_systems / build-brain (pull_request) Successful in 55s
build_systems / build-bob (pull_request) Successful in 57s
build_systems / build-leviathan (pull_request) Successful in 1m7s
build_systems / build-rhapsody-in-green (pull_request) Successful in 1m8s
build_systems / build-jeeves (pull_request) Successful in 2m45s

This commit is contained in:
2026-06-12 14:57:59 -04:00
parent cd38a0f277
commit 06ff6ae32b
2 changed files with 16 additions and 0 deletions
+2
View File
@@ -18,6 +18,7 @@ from python.ebook_search.api.routes import admin_router, page_router, search_rou
from python.ebook_search.api.web import STATIC_DIR
from python.ebook_search.bm25_corpus import ensure_bm25_corpus
from python.ebook_search.config import load_config
from python.fastapi_tools import ZstdMiddleware
from python.orm.common import get_postgres_engine
if TYPE_CHECKING:
@@ -45,6 +46,7 @@ async def lifespan(app: FastAPI) -> AsyncIterator[None]:
def create_app() -> FastAPI:
"""Create the EPUB search web app."""
app = FastAPI(title="EPUB Search", lifespan=lifespan)
app.add_middleware(ZstdMiddleware)
app.mount("/static", StaticFiles(directory=STATIC_DIR), name="static")
app.state.config = load_config()
logger.info(