node.js - How can I set up a node app (ember app kit) on heroku that reads ENV variables and makes the values available to the application? -
okay, i'm new node, , using node server serve static js, can't find info on anywhere.
i'm running application ember app kit, gets built node server.js
deploy, , heroku runs node server.js
.
it uses grunt building, testing, etc.
i'd know how can specify configuration variables (i.e. authentication tokens) can overridden heroku config variables.
the closest i've been able custom task reads environment variables , writes out json file gets built site (and assigned global var). works locally, doesn't take account heroku configs.
i wrote deploy script gets heroku's configs, exports them environment variables locally, , build--which works, configs updated on app deploy. if heroku config:add config_test=test_value
, app doesn't see value config_test
until next time deploy app.
i'd app start embedding config value in browser js immediately.
any way node way app set up?
i not sure understand what's wrong taking config variables, @ run time, environment. use process.env.key in code, , embed result whatever template may have, , serve result.
when change heroku config variables process gets restarted, picks new values.
is problem fact serve static files? if -- can change use template engine processing on them before serving?
Comments
Post a Comment