def on_get(self, req, resp):
'''
Healthcheck endpoint. Returns contents of healthcheck file.
**Example request**:
.. sourcecode:: http
GET /v0/healthcheck HTTP/1.1
**Example response**:
.. sourcecode:: http
HTTP/1.1 200 OK
Content-Type: text/plain
GOOD
'''
try:
with open(self.healthcheck_path) as f:
health = f.readline().strip()
except:
raise HTTPNotFound()
resp.status = HTTP_200
resp.content_type = 'text/plain'
resp.body = health
评论列表
文章目录