Closed hayderma closed 6 years ago
For those who may come across this issue in the future, after further debugging I found :
The configuration can be accessed with req.a127.config('attributeName')
, not req.config
, also it turned out that config
is a function, not a JSON object, thus must pass key name to it.
I am trying to load environment configuration files, but neither my
default.yaml
nor my newly addeddev.yaml
are being loaded, I am using webstorm and added environment variableNODE_ENV=dev
, I also tried it from commandlinenode app.js NODE_ENV=dev
, alsoa127 project start NODE_ENV=dev
, also trieda127 project start dev
. Nothing is working, the codereq.config.varName
andreq.config
are both returningundefined
from inside the controllers , I tried switching NODE_ENV off (should load default.yaml by default) but it is also returning undefined. below is myapp.js
This is the debugger console, I can clearly see that the configs are there but too deep, and they return undefined when i tried accessing them.