- 在data-service中添加aktools依赖和运行配置 - 更新Traefik配置添加压缩中间件 - 修改Consul配置启用ACL - 更新README添加架构图和开发指南 - 添加架构图文档
20 lines
482 B
Python
20 lines
482 B
Python
from flask import Flask, jsonify
|
|
import threading
|
|
import subprocess
|
|
from register import register_to_consul
|
|
|
|
app = Flask(__name__)
|
|
|
|
@app.route("/health")
|
|
def health():
|
|
return jsonify({"status": "ok"}), 200
|
|
|
|
@app.route("/hello")
|
|
def hello():
|
|
return jsonify({"message": "Hello from service!"})
|
|
|
|
if __name__ == "__main__":
|
|
threading.Thread(target=register_to_consul).start()
|
|
subprocess.Popen(["aktools", "run", "--port", "8001"])
|
|
app.run(host="0.0.0.0", port=8000)
|