Open ssh-randy opened 8 years ago
You have trailing comma in your development.json, after "port": 8090,
Following works like a charm:
{
"nodeServer": "http://localhost:8090",
"port": 8090
}
Can you please try this:
Instead of:
config.file('development', 'development.json');
use:
config.file('development', 'config/development.json');
@loremaps but, looks like development.json
in the same directory as config.js
...and it's in the same directory as config.js
@popenkomaksim indeed, I would expect this to work too. However, I run into this issue myself: my configuration file (json) is in the same folder as my config.js file (the directory was named "config" as well, under my project's root directory).
If I do not use the path config/development.json
I always get undefined same as @ssh-randy reported. I am not sure if this is a bug, as I started checking nconf today. However, inlcuding the folder name resolved the issue for me.
So I'm trying to follow the example closely, I have:
Yet the output is always undefined. my json is defined as such:
and it's in the same directory as config.js. Any idea why this is occurring?
Also want to note, in my main server.js I have:
and that also returns undefined.