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
According to the doc, we can access config in main file by:
const configService = app.get(ConfigService);
while this may be not possible for microservice.
asyncfunctionbootstrap(){// how to access config via app before app was created ❓// const PORT = app.get(ConfigService).get('PORT');constPORT=4000;constapp=awaitNestFactory.createMicroservice<MicroserviceOptions>(AppModule,{transport: Transport.TCP,options: {port: PORT,},},);awaitapp.listen(()=>Logger.log(`microservice started on ${PORT}`));}
The text was updated successfully, but these errors were encountered:
According to the doc, we can access config in main file by:
while this may be not possible for microservice.
The text was updated successfully, but these errors were encountered: