Skip to content

Commit

Permalink
Don't destroy global config object
Browse files Browse the repository at this point in the history
This will encourage people not to destory their window.ENV object by
reassigning it a completely new value.

The environemnt specific files should load after `environemnt.js` has
loaded. This way the values assigned to `window.ENV` in those
environment specific files can overwrite any defaults set in
`environment.js`

I have also cleaned up the comments somewhat and included a simple
example of setting a config value.
  • Loading branch information
bcardarella committed Dec 12, 2013
1 parent 041a2d3 commit f55c74e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
6 changes: 4 additions & 2 deletions config/environments/development.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// Put your development configuration here.
// This might be useful when using a separate API
//
// This is useful when using a separate API
// endpoint in development than in production.
window.ENV = {};
//
// window.ENV.public_key = '123456'
2 changes: 2 additions & 0 deletions config/environments/production.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
//
// This is useful when using a separate API
// endpoint in development than in production.
//
// window.ENV.public_key = '123456'
3 changes: 2 additions & 1 deletion config/environments/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
//
// This is useful when using a separate API
// endpoint in test than in production.

//
// window.ENV.public_key = '123456'

0 comments on commit f55c74e

Please sign in to comment.