瀏覽代碼

Refactor health check response structure to include server instance details

- Updated the health check response to return a nested object containing server ID and instance information.
- Replaced `pm_id` with `SERVER_ID` and added `NODE_APP_INSTANCE` for better clarity on server status.
0es 1 月之前
父節點
當前提交
8098a75dd9
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      server/routes/health.ts

+ 4 - 1
server/routes/health.ts

@@ -1,6 +1,9 @@
 export default defineEventHandler(() => {
   return {
-    id: process.env.pm_id || 'unknown',
+    node: {
+      id: process.env.SERVER_ID || 'unknown',
+      instance: process.env.NODE_APP_INSTANCE || 'unknown',
+    },
     timestamp: Date.now(),
     version: process.env.VERSION || 'unknown',
   }