Skip to content

Q: Dev/Production config settings for client? #562

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

Open
simonh1000 opened this issue Sep 16, 2014 · 4 comments
Open

Q: Dev/Production config settings for client? #562

simonh1000 opened this issue Sep 16, 2014 · 4 comments
Labels

Comments

@simonh1000
Copy link

Is there already a way to implement client side config values during development (e.g. for Google Analytics and Maps API keys). This seems to be a way of doing it that I will use otherwise: http://newtriks.com/2013/11/29/environment-specific-configuration-in-angularjs-using-grunt/

@JaKXz JaKXz added the question label Sep 17, 2014
@gintsgints
Copy link
Contributor

I had like same question and ended up using upstart/forever script with all needed variables set as enviroment variables inside deployment host itself.

@kingcody
Copy link
Member

@simonh1000 I use jade as an HTML preprocessor and I typically convert index.html to a jade file as well. If that works for you, I'd suggest using express locals bound to config or process.env entries.

@simonh1000
Copy link
Author

Thanks for the idea but on this occasion I'm only deploying the client code, so Jade is not an option (unless grunt:build precompiles pages)

@kingcody
Copy link
Member

Wow, I must be tired... Grunt actually compiles the jade files on builds and serves, and NOT rendered by express (somehow wasn't thinking about this, only server/views is rendered). You can place your template vars in the grunt config object for the jade task under compile.config.data. You can then use grunt config strings to bind your template vars to your config/env.

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

No branches or pull requests

4 participants