健康检查
接口说明
检查服务健康状态。
请求信息
- Method:
GET - Path:
/health - 认证: 不需要
响应示例(正常)
json
{
"status": "healthy"
}错误响应 (503)
json
{
"status": "unhealthy",
"error": "database connection failed"
}示例代码
bash
curl -X GET http://localhost:8081/healthjavascript
const response = await fetch('http://localhost:8081/health');
const data = await response.json();
console.log(data.status);python
import requests
response = requests.get('http://localhost:8081/health')
data = response.json()
print(data['status'])