From c9763181c32ec3e150f1d1b73ac1c4287cb646f5 Mon Sep 17 00:00:00 2001 From: Max Nanis Date: Sun, 13 Sep 2026 21:06:40 -0700 Subject: no html cache, crazy gitignore, manfiest parsing, html file to fstring for replacement. manually copying the manfiest file from jenkins for now --- jb/main.py | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) (limited to 'jb/main.py') diff --git a/jb/main.py b/jb/main.py index e30bb38..325bf53 100644 --- a/jb/main.py +++ b/jb/main.py @@ -7,7 +7,7 @@ from starlette.middleware.cors import CORSMiddleware from starlette.middleware.trustedhost import TrustedHostMiddleware from jb.config import settings -from jb.settings import BASE_HTML +from jb.settings import BASE_HTML, load_manifest from jb.views.auth import auth_router from jb.views.common import common_router @@ -45,9 +45,39 @@ def return_nothing() -> dict[str, Any]: @app.get("/{full_path:path}") def serve_react_app(full_path: str): + + manifest = load_manifest() + entry = manifest["src/main.tsx"] + js_file = entry["file"] + css_file = manifest["style.css"]["file"] + + html = f""" + + + + + James Billings loves you. + + + +
+ + + """ + # This serves index.html for any unmatched route # React Router will then handle the client-side routing - return HTMLResponse(BASE_HTML) + return HTMLResponse( + html, + headers={ + "Cache-Control": "no-cache, no-store, must-revalidate", + "Pragma": "no-cache", + "Expires": "0", + }, + ) def schedule_tasks(): -- cgit v1.2.3