node.jsherokuconfigsystem-variable

How do I set home folder in Heroku system variable?


I'm deploying a node.js app on Heroku dyno and using config module that requires me to define a system variable NODE_CONFIG_DIR with the location of the config folder.

The config folder is located on my project's root.

I tried to define the system variable NODE_CONFIG_DIR using the following values, all failed:

./config
~/config
app/config
~/app/config
./app/config
$HOME/config
$HOME/app/config

I keep getting this error:

WARNING: No configurations found in configuration directory:app/config

(replace app/config with any of the values above)

I manage to set a system variable, but its value is not pointing the right place.

What is the correct way to refer to the root of my tree when using a system variable in Heroku?


Solution

  • It was my bad...

    Both answers are correct but didn't solve my issue.

    The problem was that I used lowercase for my configuration file name while the NODE_ENV value was uppercase.