nestforge-config
A NestJS-inspired configuration module for NestForge applications.
Features
- Type-safe configuration - Get typed values from environment variables
- NestJS-like API - Familiar patterns for NestJS developers
- DI Integration - Seamlessly works with NestForge's dependency injection
- Simple getters - No unwrap_or chains, just
get_string_or("KEY", "default") - Dotenv support - Automatic loading from
.envfiles
Quick Start
use ;
pub type AppConfig = ConfigService;
Usage in Services
use *;
Available Methods
| Method | Description |
|---|---|
get_string("KEY") |
Get string (default: "") |
get_string_or("KEY", "default") |
Get with default |
get_u16("KEY") |
Get u16 (default: 0) |
get_u16_or("KEY", 3000) |
Get with default |
get_bool("KEY") |
Get bool (default: false) |
get_bool_or("KEY", true) |
Get with default |
get("KEY") |
Get Option<&str> |
has("KEY") |
Check if key exists |