mirror of
https://github.com/OpenHands/OpenHands.git
synced 2025-12-26 05:48:36 +08:00
18 lines
386 B
Python
18 lines
386 B
Python
from fastapi import FastAPI
|
|
|
|
from openhands.runtime.utils.system_stats import get_system_info
|
|
|
|
|
|
def add_health_endpoints(app: FastAPI):
|
|
@app.get('/alive')
|
|
async def alive():
|
|
return {'status': 'ok'}
|
|
|
|
@app.get('/health')
|
|
async def health() -> str:
|
|
return 'OK'
|
|
|
|
@app.get('/server_info')
|
|
async def get_server_info():
|
|
return get_system_info()
|