refactor: define the Dify project version in pyproject.toml (#20910)

This commit is contained in:
Bowen Liang
2025-07-01 12:07:24 +08:00
committed by GitHub
parent cf2173644e
commit 1a7ad195f0
13 changed files with 77 additions and 15 deletions

View File

@@ -12,14 +12,14 @@ def init_app(app: DifyApp):
@app.after_request
def after_request(response):
"""Add Version headers to the response."""
response.headers.add("X-Version", dify_config.CURRENT_VERSION)
response.headers.add("X-Version", dify_config.project.version)
response.headers.add("X-Env", dify_config.DEPLOY_ENV)
return response
@app.route("/health")
def health():
return Response(
json.dumps({"pid": os.getpid(), "status": "ok", "version": dify_config.CURRENT_VERSION}),
json.dumps({"pid": os.getpid(), "status": "ok", "version": dify_config.project.version}),
status=200,
content_type="application/json",
)