Configuration module for Nest.js (wraps convict module).
npm i -S nest-config
import { ConfigModule } from 'nest-config';
import { Module } from '@nestjs/common';
@Module({
imports: [ConfigModule.forRoot(schema: convict.Schema<T> | string)],
})
export class AppModule {
}
export class UserController {
constructor (
private config: ConfigService
) { }
hello() {
const foo = this.config.get<string>('foo');
}
}