Configuration property "JWT_KEY" is not defined
Closed this issue · 4 comments
Getting Configuration property "JWT_KEY" is not defined error while running. How do I fix it?
@padamshrestha I think you need to set up the config/development.json file with something like this:
{ "JWT_KEY": "MySecret!123", "MONGO_URI": "mongodb://localhost:27017/yourdb", "PORT": "3000", "HOST": "localhost" }
I can imagine that to run in production mode it will be needed to set up the config/default.json as well.
Awesome thanks
This solution works, thank you very much @fredericomaia10 , and I guess it might be better if an example folder is in the source project so that new users do not need to guess, thanks again
this solution did not work for me, working with docker, I get the error:
WARNING: No configurations found in configuration directory:/opt/app/config
nest-server | WARNING: To disable this warning set SUPPRESS_NO_CONFIG_WARNING in the environment.
nest-server | Error: Configuration property "MONGO_URI" is not defined
nest-server | at Config.get (/opt/app/node_modules/config/lib/config.js:203:11)
nest-server | at Object. (/opt/src/shared/configuration/configuration.service.ts:7:79)
nest-server | at Module._compile (internal/modules/cjs/loader.js:778:30)
nest-server | at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
nest-server | at Module.load (internal/modules/cjs/loader.js:653:32)
nest-server | at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
nest-server | at Function.Module._load (internal/modules/cjs/loader.js:585:3)
nest-server | at Module.require (internal/modules/cjs/loader.js:692:17)
nest-server | at Module.Hook._require.Module.require (/usr/local/share/.config/yarn/global/node_modules/require-in-the-middle/index.js:70:39)
nest-server | at require (internal/modules/cjs/helpers.js:25:18)
nest-server | at Object. (/opt/src/app.module.ts:6:1)
nest-server | at Module._compile (internal/modules/cjs/loader.js:778:30)
nest-server | at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
nest-server | at Module.load (internal/modules/cjs/loader.js:653:32)
nest-server | at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
nest-server | at Function.Module._load (internal/modules/cjs/loader.js:585:3)