添加核心微服务组件包括数据服务、量化服务、情绪分析服务等 实现基于Consul的服务发现和Traefik网关路由 包含Docker化部署方案和CI/CD Webhook支持
18 lines
405 B
Python
18 lines
405 B
Python
from flask import Flask, jsonify
|
|
import threading
|
|
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()
|
|
app.run(host="0.0.0.0", port=8002)
|