Spaces:
Sleeping
Sleeping
Artem Nikolaev commited on
Commit ·
aa619f3
1
Parent(s): f794952
Fix CSS and JS routes to match /web/ prefix
Browse files- backend.py +2 -2
- web/index.html +1 -1
backend.py
CHANGED
|
@@ -65,12 +65,12 @@ async def get_app():
|
|
| 65 |
return HTMLResponse(content=f.read())
|
| 66 |
return HTMLResponse(content="<h1>index.html not found</h1>", status_code=404)
|
| 67 |
|
| 68 |
-
@app.get("/style.css")
|
| 69 |
async def get_css():
|
| 70 |
with open("web/style.css", "r", encoding="utf-8") as f:
|
| 71 |
return HTMLResponse(content=f.read(), media_type="text/css")
|
| 72 |
|
| 73 |
-
@app.get("/script.js")
|
| 74 |
async def get_js():
|
| 75 |
with open("web/script.js", "r", encoding="utf-8") as f:
|
| 76 |
return HTMLResponse(content=f.read(), media_type="application/javascript")
|
|
|
|
| 65 |
return HTMLResponse(content=f.read())
|
| 66 |
return HTMLResponse(content="<h1>index.html not found</h1>", status_code=404)
|
| 67 |
|
| 68 |
+
@app.get("/web/style.css")
|
| 69 |
async def get_css():
|
| 70 |
with open("web/style.css", "r", encoding="utf-8") as f:
|
| 71 |
return HTMLResponse(content=f.read(), media_type="text/css")
|
| 72 |
|
| 73 |
+
@app.get("/web/script.js")
|
| 74 |
async def get_js():
|
| 75 |
with open("web/script.js", "r", encoding="utf-8") as f:
|
| 76 |
return HTMLResponse(content=f.read(), media_type="application/javascript")
|
web/index.html
CHANGED
|
@@ -7,7 +7,7 @@
|
|
| 7 |
<link rel="preconnect" href="https://fonts.googleapis.com">
|
| 8 |
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
| 9 |
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@100..900&display=swap" rel="stylesheet">
|
| 10 |
-
<link rel="shortcut icon" href="/
|
| 11 |
<link rel="stylesheet" href="/web/style.css">
|
| 12 |
</head>
|
| 13 |
<body>
|
|
|
|
| 7 |
<link rel="preconnect" href="https://fonts.googleapis.com">
|
| 8 |
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
| 9 |
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@100..900&display=swap" rel="stylesheet">
|
| 10 |
+
<link rel="shortcut icon" href="/web/icons/favicon.svg" type="image/x-icon">
|
| 11 |
<link rel="stylesheet" href="/web/style.css">
|
| 12 |
</head>
|
| 13 |
<body>
|