perf: Load frontend resource

This commit is contained in:
fit2cloud-chenyw
2025-04-29 10:54:10 +08:00
parent 02260ca440
commit f18eeaaf69
2 changed files with 3 additions and 1 deletions
+2 -1
View File
@@ -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
+1
View File
@@ -10,6 +10,7 @@ export default defineConfig(({ mode }) => {
console.log(mode)
console.log(env)
return {
base: './',
plugins: [
vue(),
AutoImport({