-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
error loading config.json #2
Comments
Now I finally see, that I really have to do something about this, so thanks for that. Main problem was with relative paths, because they were relative to DIConfigurator file, not to your calling file. Another problem was that I was not sure if I can do something with this and I was little (little bit more) lazy to find some solution. But tomorow (ops today) I will change this behavior to expected one. http://stackoverflow.com/questions/18144921/how-do-i-get-the-dirname-of-the-calling-method-when-it-is-in-a-different-file-in |
thank. it's no big deal. on unrelated question: is it possible to use multiple config files that would merge together? like in nette main config.neon and local.config.neon? |
Now you can use just "includes" section in config (see https://github.com/sakren/node-easy-configuration#including-other-config-files). But I think that you meant config files for different environments right? Like developmnent and production... If I'm right, can I ask you to write new issue please? |
I just figured out that there will be problem with browser support, where paths will need to stay absolute (probably). Better documentation will be also needed. |
@bazo i just released new version 2.2.0 with support for relative paths. I also updated module easy-configuration. And there I added among others support for different environments (or better sections to load - development, production, ...). If you want to use other config files (or sections from config files) you will have to follow these steps and read documentation here. |
my folder structure is
i tried to load the config.json, with dot, not dot, slash, no slash
i get exception Cannot find module './config/config.json'
workaround i found for this is
var configFilePath = fs.realpathSync('./config/config.json');
var configurator = new DIConfigurator(configFilePath);
but i dont think this is the way it is intended.
The text was updated successfully, but these errors were encountered: