Skip to content
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

What's the best way to cope with variables that depend on other variables #221

Open
tkrugg opened this issue May 5, 2016 · 1 comment
Open

Comments

@tkrugg
Copy link

tkrugg commented May 5, 2016

Say for example I have two variables

{
   "port": 3000
   "url": "http://site.com:{port}"
}

I'd like that when I call nconf.get("url"), I get "http://site.com:3000".
I tried

nconf.set("url", nconf.get("url").replace(...));

but it seems that once a variable is "loaded" into nconf, it's impossible to override it.
Question 1: can I force nconf.set to override a variable that's already been declared?
Question 2: what's the recommended way to cope with variables that depend on each other?

@tkrugg
Copy link
Author

tkrugg commented May 5, 2016

it looks like i just posted a dup of #197 #187 #166

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant