mirror of
https://gitee.com/dify_ai/dify.git
synced 2024-12-06 05:08:14 +08:00
16 lines
350 B
Python
16 lines
350 B
Python
from flask import Flask
|
|
|
|
|
|
def init_app(app: Flask):
|
|
if app.config.get("API_COMPRESSION_ENABLED"):
|
|
from flask_compress import Compress
|
|
|
|
app.config["COMPRESS_MIMETYPES"] = [
|
|
"application/json",
|
|
"image/svg+xml",
|
|
"text/html",
|
|
]
|
|
|
|
compress = Compress()
|
|
compress.init_app(app)
|