{"action":"closed","issue":{"url":"https://api.github.com/repos/mwaylabs/generator-m/issues/224","labels_url":"https://api.github.com/repos/mwaylabs/generator-m/issues/224/labels{/name}","comments_url":"https://api.github.com/repos/mwaylabs/generator-m/issues/224/comments","events_url":"https://api.github.com/repos/mwaylabs/generator-m/issues/224/events","html_url":"https://github.com/mwaylabs/generator-m/issues/224","id":99437853,"number":224,"title":"Injecting variables into environment JSON files","user":{"login":"gmarziou","id":361007,"avatar_url":"https://avatars.githubusercontent.com/u/361007?v=3","gravatar_id":"","url":"https://api.github.com/users/gmarziou","html_url":"https://github.com/gmarziou","followers_url":"https://api.github.com/users/gmarziou/followers","following_url":"https://api.github.com/users/gmarziou/following{/other_user}","gists_url":"https://api.github.com/users/gmarziou/gists{/gist_id}","starred_url":"https://api.github.com/users/gmarziou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gmarziou/subscriptions","organizations_url":"https://api.github.com/users/gmarziou/orgs","repos_url":"https://api.github.com/users/gmarziou/repos","events_url":"https://api.github.com/users/gmarziou/events{/privacy}","received_events_url":"https://api.github.com/users/gmarziou/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-06T13:48:20Z","updated_at":"2015-08-06T17:56:53Z","closed_at":"2015-08-06T17:56:53Z","body":"Hello,\r\n\r\nCurrently in my `env-dev.json` I have hard-coded the URL of my backend server running on my local PC, it works fine as my phone is able to connect but it means that other team members have to change the IP address in the URL.\r\n\r\nI found on stackoverflow a function that retrieves my IP address but I don't know how to inject it into  `env-dev.json` as it uses static values. \r\nHave you considered using  some minimal template engine like [ejs](http://www.embeddedjs.com/) or [mustache.js](https://github.com/janl/mustache.js) to be able to inject such dynamic values?\r\n\r\nMaybe my use case is too narrow or maybe there is a better way to achieve same goal.\r\n\r\n\r\n~~~~javascript\r\nfunction getIPAddress() {\r\n  var interfaces = os.networkInterfaces();\r\n  for (var devName in interfaces) {\r\n    var iface = interfaces[devName];\r\n\r\n    for (var i = 0; i < iface.length; i++) {\r\n      var alias = iface[i];\r\n      if (alias.family === 'IPv4' && alias.address !== '127.0.0.1' && !alias.internal)\r\n        return alias.address;\r\n    }\r\n  }\r\n\r\n  return '127.0.0.1';\r\n}\r\n~~~~"}}