mirror of
https://gh-proxy.org/https://github.com/klinsmaya/SQLBot.git
synced 2026-11-08 17:26:55 +08:00
perf: Load frontend resource
This commit is contained in:
+2
-1
@@ -45,11 +45,12 @@ if not os.path.exists(frontend_dist):
|
||||
logging.warning("Please make sure you have built the front-end project")
|
||||
|
||||
else:
|
||||
app.mount("/static", StaticFiles(directory=frontend_dist), name="static")
|
||||
|
||||
@app.get("/", include_in_schema=False)
|
||||
async def read_index():
|
||||
return FileResponse(path=os.path.join(frontend_dist, "index.html"))
|
||||
|
||||
app.mount("/", StaticFiles(directory=frontend_dist), name="static")
|
||||
|
||||
if __name__ == "__main__":
|
||||
import uvicorn
|
||||
|
||||
Reference in New Issue
Block a user