frozeman/meteor-build-client

How get Server URL dynamically at run time via server environment variable

AnjaniKumar15 opened this issue · 4 comments

Please suggest me how get server URL dynamically at run time via server environment variable.

I don't know from the top of my head. Please refer to the npm docs for this

On 20 Oct 2016, at 15:54, Anjani Kumar notifications@github.com wrote:

Please suggest me how get server URL dynamically at run time via server environment variable.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

Actually I am using your package to build my meteor client application. if I had provided meteor server URL at build time then it works fine, but I want to give meteor server URL at run time dynamically (ex. environment variable) then Is any way to do this thing?
Its required because we have two Meteor admin servers and I want, when I change URL path of my client app hosted server environment variable, My meteor Client app redirect and connect with other server.

Hello @AnjaniKumar15,

I'm afraid it would not possible as server URL is hardcoded into __meteor_runtime_config__ from settings Object;

You can replace server's URL in generated index.html template with needed value before serving it to user on NGINX or whatever server you're using.

Ran through the thread, years later I still think you should go with two builds with different settings

Feel free to close it in case if the issue is solved on your end.