diff --git a/examples/valueSubstitution/app.d b/examples/valueSubstitution/app.d index 81521e7..82b6f89 100644 --- a/examples/valueSubstitution/app.d +++ b/examples/valueSubstitution/app.d @@ -16,8 +16,9 @@ void main() { // This example shows how values in configuration can be substituted from // environment variables or other configuration paths. - environment["subject"] = "world"; + environment["CONFIG_EXAMPLE_SUBJECT"] = "world"; auto config = loadJsonConfig("config.json"); - writeln(config.get("greeting")); + writeln(config.get("start")); // "Hello world! Enjoy your day!" + writeln(config.get("end")); // "Bye!" } diff --git a/examples/valueSubstitution/config.json b/examples/valueSubstitution/config.json index e570a9f..8fe7f60 100644 --- a/examples/valueSubstitution/config.json +++ b/examples/valueSubstitution/config.json @@ -4,5 +4,6 @@ "subject": "$CONFIG_EXAMPLE_SUBJECT", "followUp": "${CONFIG_EXAMPLE_FOLLOW_UP:Enjoy your day!}" }, - "greeting": "${parameters.greeting} ${parameters.subject}! ${parameters.followUp}" + "start": "${parameters.greeting} ${parameters.subject}! ${parameters.followUp}", + "end": "${parameters.farewell:Bye!}" }