fix: 添加根路由 + 修复 CORS 拼写
This commit is contained in:
@@ -11,7 +11,7 @@ from app.extensions import (
|
||||
)
|
||||
|
||||
# Socket.IO 实例 - 避免与 app/socketio 目录冲突
|
||||
socketio_app = SocketIO(cors_allowed_origions="*", async_mode='threading')
|
||||
socketio_app = SocketIO(cors_allowed_origins="*", async_mode='threading')
|
||||
|
||||
|
||||
def create_app(config_name='default'):
|
||||
@@ -34,6 +34,25 @@ def create_app(config_name='default'):
|
||||
# 注册错误处理
|
||||
_register_error_handlers(app)
|
||||
|
||||
# 根路由
|
||||
@app.route('/')
|
||||
def index():
|
||||
return {
|
||||
'service': 'PIT Router',
|
||||
'version': '0.6.0',
|
||||
'status': 'running',
|
||||
'endpoints': {
|
||||
'health': '/health',
|
||||
'auth': '/api/auth',
|
||||
'sessions': '/api/sessions',
|
||||
'agents': '/api/agents',
|
||||
'gateways': '/api/gateways',
|
||||
'messages': '/api/messages',
|
||||
'stats': '/api/stats',
|
||||
'websocket': 'ws://host:9000'
|
||||
}
|
||||
}
|
||||
|
||||
# 健康检查端点
|
||||
@app.route('/health')
|
||||
def health_check():
|
||||
|
||||
Reference in New Issue
Block a user