<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div><div>One suggestion:</div><div><br></div><div>The application lib must be loaded before get_env() can work.</div><div><br></div><div>BR,</div><div>Ulf W</div><br><div><div>On 7 Jan 2013, at 15:15, AD wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">Hello,<div><br></div><div> I have a library being built that is leveraging environment variables.  There is a line in the library include file that looks like</div><div><br></div><div>-define(CONST, lib:get_env(Key,Default)).</div>
<div><br></div><div style="">the lib:get_env function simply checks</div><div style=""><br></div><div style="">    application:get_env(lib, Key) % in order to check the library.app first</div><div style=""> and then</div><div style="">   application:get_env(Key) % check for local overrides </div>
<div style=""><br></div><div style=""> However when i place variables like the following in the main example.app file in ebin/</div><div style=""><br></div><div style=""><div>{application,example,</div><div>             [{description,[]},</div>
<div>              {env,[{'COWBOY_HTTP_PORT',9090}]},</div><div>              ......</div><div><br></div><div style="">Nothing is getting read.  I am not sure if this needs to be in rel/files/app.config instead?</div>
<div style=""><br></div><div style="">Appreciate any help here.</div><div style=""><br></div><div style="">-AD</div></div><div style=""><br></div><div style=""> </div></div>
_______________________________________________<br>erlang-questions mailing list<br><a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>http://erlang.org/mailman/listinfo/erlang-questions<br></blockquote></div><br><div apple-content-edited="true">
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div><div>Ulf Wiger, Co-founder & Developer Advocate, Feuerlabs Inc.</div><div><a href="http://feuerlabs.com">http://feuerlabs.com</a></div></div><div><br></div></span><br class="Apple-interchange-newline">
</div>
<br></body></html>