Merge branch 'master' into master

This commit is contained in:
vastsa
2022-12-13 22:13:27 +08:00
committed by GitHub
7 changed files with 16 additions and 16 deletions
+3 -2
View File
@@ -22,8 +22,9 @@ app = FastAPI(debug=settings.DEBUG)
DATA_ROOT = Path(settings.DATA_ROOT)
if not DATA_ROOT.exists():
DATA_ROOT.mkdir(parents=True)
# 静态文件夹
app.mount(settings.STATIC_URL, StaticFiles(directory=DATA_ROOT), name="static")
# 静态文件夹,这个固定就行了,静态资源都放在这里
app.mount(settings.STATIC_URL, StaticFiles(directory='./static'), name="static")
@app.on_event('startup')