Files
scrypted/server/src/server-settings.ts
Koushik Dutta 5dde5ae893 fix: add type annotations for network address functions
- Add parseInt with empty string fallback for undefined env vars
- getIpAddress returns string | undefined when no addresses available
- Add type guard filters for network interface arrays
2026-04-02 13:33:12 -07:00

11 lines
537 B
TypeScript

import { getUsableNetworkAddresses } from './ip';
export const SCRYPTED_INSECURE_PORT = parseInt(process.env.SCRYPTED_INSECURE_PORT ?? '') || 11080;
export const SCRYPTED_SECURE_PORT = parseInt(process.env.SCRYPTED_SECURE_PORT ?? '') || 10443;
export const SCRYPTED_DEBUG_PORT = parseInt(process.env.SCRYPTED_DEBUG_PORT ?? '') || 10081;
export const SCRYPTED_CLUSTER_WORKERS = parseInt(process.env.SCRYPTED_CLUSTER_WORKERS ?? '') || 32;
export function getIpAddress(): string | undefined {
return getUsableNetworkAddresses()[0];
}