feat(ide_services): add endpoint for retrieving local service port
Add a new endpoint `/get_local_service_port` to ide_services for obtaining the port number of the local service. This endpoint utilizes the `getLocalServicePort` function, which logs the local service port and retrieves it from the environment variable `DC_LOCALSERVICE_PORT`.
This commit is contained in:
parent
adedbec510
commit
3e2ccd5ab2
@ -7,3 +7,10 @@ export async function getServicePort() {
|
||||
// return await UiUtilWrapper.getLSPBrigePort();
|
||||
return process.env.DEVCHAT_IDE_SERVICE_PORT;
|
||||
}
|
||||
|
||||
export async function getLocalServicePort() {
|
||||
logger
|
||||
.channel()
|
||||
?.info(`get local service port: ${process.env.DC_LOCALSERVICE_PORT}`);
|
||||
return process.env.DC_LOCALSERVICE_PORT;
|
||||
}
|
@ -3,7 +3,7 @@ import * as http from "http";
|
||||
import * as querystring from "querystring";
|
||||
import { logger } from "../util/logger";
|
||||
|
||||
import { getServicePort } from "./endpoints/getServicePort";
|
||||
import { getServicePort, getLocalServicePort } from "./endpoints/getServicePort";
|
||||
import { installPythonEnv } from "./endpoints/installPythonEnv";
|
||||
import { ideLogging} from "./endpoints/ideLogging";
|
||||
import { updateSlashCommands } from "./endpoints/updateSlashCommands";
|
||||
@ -26,6 +26,10 @@ const functionRegistry: any = {
|
||||
keys: [],
|
||||
handler: getServicePort,
|
||||
},
|
||||
"/get_local_service_port": {
|
||||
keys: [],
|
||||
handler: getLocalServicePort,
|
||||
},
|
||||
"/install_python_env": {
|
||||
keys: ["command_name", "requirements_file"],
|
||||
handler: installPythonEnv,
|
||||
|
Loading…
x
Reference in New Issue
Block a user