You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

11 lines
303 B

from fastapi import FastAPI
from fastapi.staticfiles import StaticFiles
from config.env import UploadConfig
def mount_staticfiles(app: FastAPI):
"""
挂载静态文件
"""
app.mount(f'{UploadConfig.UPLOAD_PREFIX}', StaticFiles(directory=f'{UploadConfig.UPLOAD_PATH}'), name='profile')