You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// src/app.module.ts (simplified)import{Global,Module}from'@nestjs/common'import{DataAccessModule}from'./data-access.module'import{LogModule}from'./log.route/log.module'import{ApplicationController}from'./application.route/application.controller'import*aspathfrom'path'import{ConfigModule}from'nestjs-config'constconfigPath=path.resolve(__dirname,'config','config.js')console.log(configPath)// this outputs C:\Users\lcartreul\Documents\projecten\log-server\dist\src\config\config.js which is correct
@Global()
@Module({imports: [DataAccessModule.register(),LogModule,ConfigModule.load(configPath)],controllers: [ApplicationController],providers: [],exports: [DataAccessModule],})exportclassAppModule{}
import{NestFactory}from'@nestjs/core'import{AppModule}from'./app.module'import{ConfigService}from'nestjs-config'asyncfunctionbootstrap(){constapp=awaitNestFactory.create(AppModule)constconfig=app.get<ConfigService>(ConfigService)constport=config.get('port',3822)awaitapp.listen(port)console.log(`Listening on port ${port}`)// Here `3822` is returned instead of the expected `3821`}bootstrap()
The text was updated successfully, but these errors were encountered:
Issue type:
nestjs-config version
@nestjs/common+core or other package versions
Excepted behavior
settings should get the value defined in the config file,
Actual behavior or outcome (for issue)
all settings get the default values instead
Context
Trying to replace the stock nestjs/config library withnestjs-config to enable config reload at runtime
Replication/Example
The text was updated successfully, but these errors were encountered: