aboutsummaryrefslogtreecommitdiff
path: root/jb/main.py
diff options
context:
space:
mode:
authorstuppie2026-09-17 10:05:48 -0600
committerstuppie2026-09-17 10:05:48 -0600
commite73cab566ca6f40c213c9a42d34d8f6af8515589 (patch)
tree01ad453e75f8114c59708984ed53cbf066f6e365 /jb/main.py
parentbb999c73ab563b27e469fc4f74a5f81a5f35fffd (diff)
downloadamt-jb-e73cab566ca6f40c213c9a42d34d8f6af8515589.tar.gz
amt-jb-e73cab566ca6f40c213c9a42d34d8f6af8515589.zip
render_base_html to server base html with js file templated
Diffstat (limited to 'jb/main.py')
-rw-r--r--jb/main.py27
1 files changed, 2 insertions, 25 deletions
diff --git a/jb/main.py b/jb/main.py
index 325bf53..945b22c 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, load_manifest
+from jb.settings import render_base_html
from jb.views.auth import auth_router
from jb.views.common import common_router
@@ -45,33 +45,10 @@ 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"""<!doctype html>
- <html lang="en-US">
- <head>
- <meta charset="utf-8">
- <meta name="viewport"
- content="width=device-width, initial-scale=1.0, height=device-height, minimum-scale=1.0, user-scalable=1">
- <title>James Billings loves you.</title>
- <link rel="stylesheet"
- href="https://cdn.jamesbillings67.com/{css_file}"
- type="text/css">
- </head>
- <body>
- <div id="root"></div>
- <script src="https://cdn.jamesbillings67.com/{js_file}"></script>
- </body>
- </html>"""
-
# This serves index.html for any unmatched route
# React Router will then handle the client-side routing
return HTMLResponse(
- html,
+ render_base_html(),
headers={
"Cache-Control": "no-cache, no-store, must-revalidate",
"Pragma": "no-cache",