Spaces:
Running
Running
Commit ·
bb036b2
1
Parent(s): 2835959
fix: serve frontend static files and use relative /upload route
Browse files
backend/main.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
from fastapi import FastAPI, Request, UploadFile, File, HTTPException
|
| 2 |
from fastapi.middleware.cors import CORSMiddleware
|
|
|
|
| 3 |
from slowapi import Limiter, _rate_limit_exceeded_handler
|
| 4 |
from slowapi.util import get_remote_address
|
| 5 |
from slowapi.errors import RateLimitExceeded
|
|
@@ -61,3 +62,6 @@ async def upload_image(request: Request, file: UploadFile = File(...)):
|
|
| 61 |
}
|
| 62 |
|
| 63 |
return response
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
from fastapi import FastAPI, Request, UploadFile, File, HTTPException
|
| 2 |
from fastapi.middleware.cors import CORSMiddleware
|
| 3 |
+
from fastapi.staticfiles import StaticFiles
|
| 4 |
from slowapi import Limiter, _rate_limit_exceeded_handler
|
| 5 |
from slowapi.util import get_remote_address
|
| 6 |
from slowapi.errors import RateLimitExceeded
|
|
|
|
| 62 |
}
|
| 63 |
|
| 64 |
return response
|
| 65 |
+
|
| 66 |
+
|
| 67 |
+
app.mount("/", StaticFiles(directory="../dist", html=True), name="static")
|
dist/assets/{index-ClwSBOT-.js → index-DrDnKmSD.js}
RENAMED
|
The diff for this file is too large to render.
See raw diff
|
|
|
dist/index.html
CHANGED
|
@@ -8,7 +8,7 @@
|
|
| 8 |
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
| 9 |
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
| 10 |
<link href="https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;900&family=Crimson+Text:ital,wght@0,400;0,600;1,400&display=swap" rel="stylesheet" />
|
| 11 |
-
<script type="module" crossorigin src="/assets/index-
|
| 12 |
<link rel="stylesheet" crossorigin href="/assets/index-DbeeC0D7.css">
|
| 13 |
</head>
|
| 14 |
<body>
|
|
|
|
| 8 |
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
| 9 |
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
| 10 |
<link href="https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;900&family=Crimson+Text:ital,wght@0,400;0,600;1,400&display=swap" rel="stylesheet" />
|
| 11 |
+
<script type="module" crossorigin src="/assets/index-DrDnKmSD.js"></script>
|
| 12 |
<link rel="stylesheet" crossorigin href="/assets/index-DbeeC0D7.css">
|
| 13 |
</head>
|
| 14 |
<body>
|