feat(desktop): 拆分 sidecar 管理并接入健康检查路由

This commit is contained in:
2026-02-16 04:06:41 +08:00
parent aa1e2c81c6
commit e76a03d0f4
4 changed files with 408 additions and 175 deletions

View File

@@ -0,0 +1,27 @@
import { createFileRoute } from '@tanstack/react-router'
import { name, version } from '@/../package.json'
const createHealthResponse = (): Response =>
Response.json(
{
status: 'ok',
service: name,
version,
timestamp: new Date().toISOString(),
},
{
status: 200,
headers: {
'cache-control': 'no-store',
},
},
)
export const Route = createFileRoute('/api/health')({
server: {
handlers: {
GET: async () => createHealthResponse(),
HEAD: async () => new Response(null, { status: 200 }),
},
},
})