fix: some endpoints are invisible (#4752)

This commit is contained in:
Louis 2025-02-27 15:08:21 +07:00 committed by GitHub
parent b849fcb493
commit 5682aa3a7e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 50 additions and 1 deletions

View File

@ -596,6 +596,11 @@
}
},
"/healthz": {
"servers": [
{
"url": "/"
}
],
"get": {
"operationId": "HealthController_check",
"summary": "Check health",
@ -613,6 +618,11 @@
}
},
"/processManager/destroy": {
"servers": [
{
"url": "/"
}
],
"delete": {
"operationId": "Terminate server process",
"summary": "Terminate server",
@ -2442,6 +2452,11 @@
}
},
"/system": {
"servers": [
{
"url": "/"
}
],
"delete": {
"operationId": "SystemController_delete",
"summary": "Stop api server",
@ -2468,6 +2483,11 @@
}
},
"/system/events/download": {
"servers": [
{
"url": "/"
}
],
"get": {
"operationId": "SystemController_downloadEvent",
"summary": "Get download status",
@ -2489,6 +2509,11 @@
}
},
"/system/events/model": {
"servers": [
{
"url": "/"
}
],
"get": {
"operationId": "SystemController_modelEvent",
"summary": "Get model status",
@ -2510,6 +2535,11 @@
}
},
"/system/events/resources": {
"servers": [
{
"url": "/"
}
],
"get": {
"operationId": "SystemController_resourcesEvent",
"summary": "Get resources status",

View File

@ -97,12 +97,31 @@ export const startServer = async (configs?: ServerConfig): Promise<boolean> => {
transformSpecificationClone: true,
})
server.register(require('@fastify/http-proxy'), {
const proxy = require('@fastify/http-proxy')
server.register(proxy, {
upstream: `${CORTEX_API_URL}/v1`,
prefix: configs?.prefix ?? '/v1',
http2: false,
})
server.register(proxy, {
upstream: `${CORTEX_API_URL}/system`,
prefix:'/system',
http2: false,
})
server.register(proxy, {
upstream: `${CORTEX_API_URL}/processManager`,
prefix:'/processManager',
http2: false,
})
server.register(proxy, {
upstream: `${CORTEX_API_URL}/healthz`,
prefix:'/healthz',
http2: false,
})
// Start listening for requests
await server
.listen({