refactor: Use specific SERVER_PORT and CLIENT_PORT env vars
Per PR feedback from cliffhall: - Changed PORT to SERVER_PORT in server/src/index.ts - Changed PORT to CLIENT_PORT in client/bin/client.js - Added parseInt() for CLIENT_PORT consistency - Updated start.js to pass correct env var names This improves clarity by using specific environment variables for server and client ports instead of the generic PORT variable.
This commit is contained in:
parent
fe2c5c767d
commit
d0673ba9e1
3 changed files with 6 additions and 6 deletions
|
|
@ -39,7 +39,7 @@ const server = http.createServer((request, response) => {
|
|||
return handler(request, response, handlerOptions);
|
||||
});
|
||||
|
||||
const port = process.env.PORT || 6274;
|
||||
const port = parseInt(process.env.CLIENT_PORT || "6274", 10);
|
||||
const host = process.env.HOST || "localhost";
|
||||
server.on("listening", () => {
|
||||
console.log(
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ async function startDevServer(serverOptions) {
|
|||
cwd: resolve(__dirname, "../..", "server"),
|
||||
env: {
|
||||
...process.env,
|
||||
PORT: SERVER_PORT,
|
||||
SERVER_PORT: SERVER_PORT,
|
||||
CLIENT_PORT: CLIENT_PORT,
|
||||
MCP_PROXY_TOKEN: sessionToken,
|
||||
MCP_ENV_VARS: JSON.stringify(envVars),
|
||||
|
|
@ -90,7 +90,7 @@ async function startProdServer(serverOptions) {
|
|||
{
|
||||
env: {
|
||||
...process.env,
|
||||
PORT: SERVER_PORT,
|
||||
SERVER_PORT: SERVER_PORT,
|
||||
CLIENT_PORT: CLIENT_PORT,
|
||||
MCP_PROXY_TOKEN: sessionToken,
|
||||
MCP_ENV_VARS: JSON.stringify(envVars),
|
||||
|
|
@ -115,7 +115,7 @@ async function startDevClient(clientOptions) {
|
|||
|
||||
const client = spawn(clientCommand, clientArgs, {
|
||||
cwd: resolve(__dirname, ".."),
|
||||
env: { ...process.env, PORT: CLIENT_PORT },
|
||||
env: { ...process.env, CLIENT_PORT: CLIENT_PORT },
|
||||
signal: abort.signal,
|
||||
echoOutput: true,
|
||||
});
|
||||
|
|
@ -163,7 +163,7 @@ async function startProdClient(clientOptions) {
|
|||
}
|
||||
|
||||
await spawnPromise("node", [inspectorClientPath], {
|
||||
env: { ...process.env, PORT: CLIENT_PORT },
|
||||
env: { ...process.env, CLIENT_PORT: CLIENT_PORT },
|
||||
signal: abort.signal,
|
||||
echoOutput: true,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -528,7 +528,7 @@ app.get("/config", originValidationMiddleware, authMiddleware, (req, res) => {
|
|||
}
|
||||
});
|
||||
|
||||
const PORT = parseInt(process.env.PORT || "6277", 10);
|
||||
const PORT = parseInt(process.env.SERVER_PORT || "6277", 10);
|
||||
const HOST = process.env.HOST || "localhost";
|
||||
|
||||
const server = app.listen(PORT, HOST);
|
||||
|
|
|
|||
Loading…
Reference in a new issue