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.
13 lines
347 B
13 lines
347 B
from fastapi import FastAPI
|
|
from middlewares.cors_middleware import add_cors_middleware
|
|
from middlewares.gzip_middleware import add_gzip_middleware
|
|
|
|
|
|
def handle_middleware(app: FastAPI):
|
|
"""
|
|
全局中间件处理
|
|
"""
|
|
# 加载跨域中间件
|
|
add_cors_middleware(app)
|
|
# 加载gzip压缩中间件
|
|
add_gzip_middleware(app)
|
|
|