These snippets demonstrate externalizing an application configuration for Javascript. This is useful to 1.) keep application configuration declarations out of your code so they can be easy changed throughout the application, and 2.) manage configuration across multiple environments where app configuration may be different for each target.
To implement:
- Create an identical app config JS file for each target (e.g. dev, test, prod)
- Modify the configuration variables in each config for each target
- Put each of these files in the same app_config folder at the root of your app, and add to SCM