存活探针(liveness):进程活着即 200 常量,体 {ok:true, version(package.json), db:ok|down|not-configured}(db 只如实报,不改状态码);compose healthcheck 看本端点,水位判据归 /readyz
GET
/healthz
const url = 'https://api.tansr.com/healthz';const options = {method: 'GET'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.tansr.com/healthzResponses
Section titled “Responses”Ok(常量)
Media typeapplication/json
object
key
additional properties
any
Examplegenerated
{}本文是否有帮助?
感谢反馈,我们会持续改进这篇文章。