Nestjs Configuration
ASecurityInitialize `@nestjs/config` globally and give it a startup validation schema. Required variables should make boot fail immediately instead of producing a partially configured service. ```ts ConfigModule.forRoot({ isGlobal: true, validationSchema: Joi.object({ NODE_ENV: Joi.string().valid('development', 'production').default('development'), PORT: Joi.number().default(3000), DATABASE_URL: Joi.string().required(), }), }); ``` Inject `ConfigService` into modules and services, preferably through a...
- 584 stars
- 0 votes
- 0 copies
- 4 views
- Added September 5, 2026
Security analysis
100/100Pro scans all 11 files and shows the line behind each finding
npx -y skills add HoangNguyen0403/agent-skills-standard --skill nestjs-configuration --agent claude-codeAre you the author of Nestjs Configuration?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/hoangnguyen0403-nestjs-configuration-agent-skills-standard)Initialize `@nestjs/config` globally and give it a startup validation schema. Required variables should make boot fail immediately instead of producing a partially configured service.
```ts
ConfigModule.forRoot({
isGlobal: true,
validationSchema: Joi.object({
NODE_ENV: Joi.string().valid('development', 'production').default('development'),
PORT: Joi.number().default(3000),
DATABASE_URL: Joi.string().required(),
}),
});
```
Inject `ConfigService` into modules and services, preferably through a typed configuration object or getter. Never read `process.env` throughout business code, and never commit `.env` secrets.
Files in this skill
- eval-1.baseline.md
- eval-1.with-skill.md
- eval-2.baseline.md
- eval-2.with-skill.md
- eval-3.baseline.md
- eval-3.with-skill.md
- trigger-1.md
- trigger-2.md
- trigger-3.md
- trigger-4.md
Attribution
Related skills
View all in development →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.