/** * Environment utility functions for checking runtime environment */ /** * Check if the application is running in a cloud environment * Currently checks for AWS instance profile, but can be extended for other cloud providers */ export function isCloudEnvironment(): boolean { return !!(process.env.AWS_INSTANCE_PROFILE_NAME && process.env.AWS_INSTANCE_PROFILE_NAME.trim()); } /** * Check if the application can use shared OAuth keys * This is typically enabled in cloud environments to avoid storing secrets */ export function isOAuthSharedKeysAvailable(): boolean { return isCloudEnvironment(); } /** * Check if running in development mode */ export function isDevelopment(): boolean { return process.env.NODE_ENV === 'development' || !process.env.NODE_ENV; } /** * Check if running in production mode */ export function isProduction(): boolean { return process.env.NODE_ENV === 'production'; } /** * Get the API base URL from environment variable or default to localhost * @returns The API base URL */ export function getApiBaseUrl(): string { return process.env.API_BASE_URL || 'http://localhost:7130'; }