fix: show default port 3456 in status when not specified in config

When the PORT was not specified in the config file, the status command
would show "undefined" for the port. This fix ensures that the default
port 3456 is displayed instead, matching the actual behavior of the
service which uses 3456 as the default port.

Fixes the issue where `ccr status` shows undefined for port when not
configured explicitly.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
musistudio
2025-07-30 15:10:44 +08:00
parent 74fa03d3a5
commit e560db85f4

View File

@@ -75,12 +75,13 @@ export async function getServiceInfo() {
const pid = getServicePid();
const running = isServiceRunning();
const config = await readConfigFile();
const port = config.PORT || 3456;
return {
running,
pid,
port: config.PORT,
endpoint: `http://127.0.0.1:${config.PORT}`,
port,
endpoint: `http://127.0.0.1:${port}`,
pidFile: PID_FILE,
referenceCount: getReferenceCount()
};