Last active
October 29, 2016 07:09
-
-
Save fotoflo/9ef6980b3ff484630f4e8f5e91281309 to your computer and use it in GitHub Desktop.
Ngrok is a great tool which creates introspectible tunnels, however its sometimes a pain to tell your app the name of its tunnel, so here we set it via javascript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var request = require('request-promise'); | |
request('http://127.0.0.1:4040/api/tunnels') | |
.then( function(res){ | |
var tunnels = JSON.parse(res).tunnels; | |
for(var i in tunnels){ | |
console.log( 'setting NGROK_HOST_'+i+'=' + tunnels[i].public_url); | |
process.env['NGROK_HOST_'+i] = tunnels[i].public_url; | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment