How would I go about using Nest's ConfigService in the configure method of the AppModule? I need to set up the session options (e.g. secret, sameSite, maxAge) depending on the environment, so hard-coding is a no-go. Should I use some other configuration method instead?
How would I go about using Nest's
ConfigService
in theconfigure
method of theAppModule
? I need to set up the session options (e.g.secret
,sameSite
,maxAge
) depending on the environment, so hard-coding is a no-go. Should I use some other configuration method instead?You can inject the
ConfigService
just like we doRedis
and usethis.config.get('SESSION-SECRET')
or whatever else you would need to