AdministrationConfiguration Files
Environment Configuration
Configure the environment settings for your Gigantics instance. These settings control how the application behaves based on the deployment environment.
Environment Variable
The primary environment configuration is controlled by the NODE_ENV environment variable:
# This is typically not set in the YAML file but controlled by environment
# NODE_ENV can be 'development', 'production', or 'test'Environment Detection
The application automatically detects the environment and adjusts behavior accordingly:
- Development: Enhanced logging, debugging features enabled
- Production: Optimized performance, minimal logging
- Test: Special test configurations, minimal output
Setting the Environment
Using Environment Variables
# Set environment to production
export NODE_ENV=production
./gig start
# Set environment to development
export NODE_ENV=development
./gig start
# Set environment to test
export NODE_ENV=test
./gig startUsing Command Line
# Start in development mode
NODE_ENV=development ./gig start
# Start in production mode
NODE_ENV=production ./gig start
# Start in test mode
NODE_ENV=test ./gig startWindows Command Line
# Set environment variable on Windows
set NODE_ENV=production
gig.exe start
# Or set it for just one command
set NODE_ENV=production && gig.exe startEnvironment-Specific Behaviors
Development Environment
- Default encryption key:
'my-secret-key' - Log level:
'silly' - Enhanced debugging output
- Development SMTP credentials
Production Environment
- Generates secure random encryption key
- Log level:
'http' - Optimized performance settings
- Requires proper SMTP configuration
Test Environment
- Special test configurations
- Log level:
'test' - Isolated test settings
Best Practices
- Always Set Environment: Explicitly set NODE_ENV in production
- Environment Consistency: Ensure all application components run in the same environment
- Configuration by Environment: Use different configuration files for different environments
- Security: Never use development settings in production
Testing Environment Configuration
To verify environment configuration:
-
Check current environment:
echo $NODE_ENV -
Start application with specific environment:
NODE_ENV=development ./gig start -
Check logs to verify environment-specific settings are applied
Using Multiple Configuration Files
You can create environment-specific configuration files:
config/default.yaml- Base configurationconfig/development.yaml- Development overridesconfig/production.yaml- Production overridesconfig/test.yaml- Test overrides
Start with specific configuration files:
# Use development configuration
./gig start -c config/development.yaml
# Use production configuration
./gig start -c config/production.yaml