web applications - How to change configuration of web apps -



web applications - How to change configuration of web apps -

my web app depends on external services , has api access key values hardcoded in source code.

now want back upwards multiple environments, development , production. each environment want utilize different set of services different keys.

the question how alter keys in source code when switching environments?

as obvious solution can think of script patches files using environment variables. modern tools , technologies around web development think there must more elegant solution. heard grunt, didn't find appropriate plugin.

i ended solution based on suggestion in comments. created settings.env.js files containing setting variables, env prod, dev, test, etc.

then alter environment re-create 1 of tese files settings.js, included in client side code. convenience made grunt task copy:

grunt use:dev

web-applications configuration gruntjs gulp

Comments

Popular posts from this blog

php - How to pass multiple values from url -

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

database - php search bar when I press submit with nothing in the search bar it shows all the data -