Skip to content

Commit f18eeaa

Browse files
perf: Load frontend resource
1 parent 02260ca commit f18eeaa

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

backend/main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,12 @@ def custom_generate_unique_id(route: APIRoute) -> str:
4545
logging.warning("Please make sure you have built the front-end project")
4646

4747
else:
48-
app.mount("/static", StaticFiles(directory=frontend_dist), name="static")
4948

5049
@app.get("/", include_in_schema=False)
5150
async def read_index():
5251
return FileResponse(path=os.path.join(frontend_dist, "index.html"))
52+
53+
app.mount("/", StaticFiles(directory=frontend_dist), name="static")
5354

5455
if __name__ == "__main__":
5556
import uvicorn

frontend/vite.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export default defineConfig(({ mode }) => {
1010
console.log(mode)
1111
console.log(env)
1212
return {
13+
base: './',
1314
plugins: [
1415
vue(),
1516
AutoImport({

0 commit comments

Comments
 (0)