Skip to main content
API Reference / modelence / server / getConfig
getConfig(key): string | number | boolean
Defined in: src/config/server.ts:43

Parameters

ParameterTypeDescription
keystringThe configuration key to retrieve

Returns

string | number | boolean The configuration value (string, number, or boolean) getConfig (server)

Examples

import { getConfig } from 'modelence/server';

// Get the site URL
const siteUrl = getConfig('_system.site.url');
Set via environment variable:
MODELENCE_SITE_URL=https://myapp.com
import { getConfig } from 'modelence/server';

// Get the current environment (e.g., 'development', 'staging', 'production')
const env = getConfig('_system.env');

if (env === 'production') {
  // Enable production features
}
Set via environment variable:
MODELENCE_SITE_ENV=production