feat: 初始化仓库
This commit is contained in:
21
middlewares/handle.py
Normal file
21
middlewares/handle.py
Normal file
@@ -0,0 +1,21 @@
|
||||
# _*_ coding : UTF-8 _*_
|
||||
# @Time : 2025/01/18 02:45
|
||||
# @UpdateTime : 2025/01/18 02:45
|
||||
# @Author : sonder
|
||||
# @File : handle.py
|
||||
# @Software : PyCharm
|
||||
# @Comment : 本程序
|
||||
from fastapi import FastAPI
|
||||
|
||||
from middlewares.cors import add_cors_middleware
|
||||
from middlewares.gzip import add_gzip_middleware
|
||||
|
||||
|
||||
def handle_middleware(app: FastAPI):
|
||||
"""
|
||||
全局中间件处理
|
||||
"""
|
||||
# 加载跨域中间件
|
||||
add_cors_middleware(app)
|
||||
# 加载gzip压缩中间件
|
||||
add_gzip_middleware(app)
|
||||
Reference in New Issue
Block a user