mirror of
https://github.com/koush/scrypted.git
synced 2026-06-20 16:40:30 +01:00
- 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
11 lines
537 B
TypeScript
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];
|
|
}
|