{"action":"created","issue":{"url":"https://api.github.com/repos/mozilla/node-convict/issues/128","repository_url":"https://api.github.com/repos/mozilla/node-convict","labels_url":"https://api.github.com/repos/mozilla/node-convict/issues/128/labels{/name}","comments_url":"https://api.github.com/repos/mozilla/node-convict/issues/128/comments","events_url":"https://api.github.com/repos/mozilla/node-convict/issues/128/events","html_url":"https://github.com/mozilla/node-convict/issues/128","id":137587387,"number":128,"title":"env should accept an array","user":{"login":"sullivanpt","id":819239,"avatar_url":"https://avatars.githubusercontent.com/u/819239?v=3","gravatar_id":"","url":"https://api.github.com/users/sullivanpt","html_url":"https://github.com/sullivanpt","followers_url":"https://api.github.com/users/sullivanpt/followers","following_url":"https://api.github.com/users/sullivanpt/following{/other_user}","gists_url":"https://api.github.com/users/sullivanpt/gists{/gist_id}","starred_url":"https://api.github.com/users/sullivanpt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sullivanpt/subscriptions","organizations_url":"https://api.github.com/users/sullivanpt/orgs","repos_url":"https://api.github.com/users/sullivanpt/repos","events_url":"https://api.github.com/users/sullivanpt/events{/privacy}","received_events_url":"https://api.github.com/users/sullivanpt/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-03-01T14:27:20Z","updated_at":"2016-04-27T17:56:37Z","closed_at":null,"body":"Production deployment services like heroku typically use a diverse set of \"standard\" providers, each with a similar format but their own environment variable.  It'd be nice to support these \"out of the box\".  So something like:\r\n\r\n```\r\nmongoUri: {\r\n    doc: \"Mongo DB configuration string.\",\r\n    format: \"uri\",\r\n    default: 'mongodb://localhost/fullstack',\r\n    env: [\"MONGOLAB_URI\", \"MONGOHQ_URL\"]\r\n  }\r\n```"},"comment":{"url":"https://api.github.com/repos/mozilla/node-convict/issues/comments/215171238","html_url":"https://github.com/mozilla/node-convict/issues/128#issuecomment-215171238","issue_url":"https://api.github.com/repos/mozilla/node-convict/issues/128","id":215171238,"user":{"login":"LongLiveCHIEF","id":3282305,"avatar_url":"https://avatars.githubusercontent.com/u/3282305?v=3","gravatar_id":"","url":"https://api.github.com/users/LongLiveCHIEF","html_url":"https://github.com/LongLiveCHIEF","followers_url":"https://api.github.com/users/LongLiveCHIEF/followers","following_url":"https://api.github.com/users/LongLiveCHIEF/following{/other_user}","gists_url":"https://api.github.com/users/LongLiveCHIEF/gists{/gist_id}","starred_url":"https://api.github.com/users/LongLiveCHIEF/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LongLiveCHIEF/subscriptions","organizations_url":"https://api.github.com/users/LongLiveCHIEF/orgs","repos_url":"https://api.github.com/users/LongLiveCHIEF/repos","events_url":"https://api.github.com/users/LongLiveCHIEF/events{/privacy}","received_events_url":"https://api.github.com/users/LongLiveCHIEF/received_events","type":"User","site_admin":false},"created_at":"2016-04-27T17:56:36Z","updated_at":"2016-04-27T17:56:36Z","body":"This would also be a common need for picking up env vars such as proxies, which are often formatted differently between operating systems and platforms.\r\n\r\nI just went down two roads, and couldn't come up with an answer:\r\n\r\n## Coercion\r\n\r\nI thought perhaps we could coerce the values, but the coercion operates on the value of the environment variable by first identifying it from the schema provided... meaning it's already too late.\r\n\r\n## Dynamic creation of schema node via `convict.load()`;\r\n\r\nI actually have a use case right now for this as well, only instead of deciphering between two possible environment variable values, I need to decipher whether or not the value exists... but I'm running into a bit of a chicken/egg here as well.\r\n\r\nWill share some code in a bit after I work through this to be sure."}}