mirror of
https://github.com/langgenius/dify.git
synced 2024-11-16 11:42:29 +08:00
3cc6093e4b
Co-authored-by: -LAN- <laipz8200@outlook.com>
17 lines
351 B
Python
17 lines
351 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)
|
|
|