Skip to content

Instantly share code, notes, and snippets.

@bergpb
Created January 30, 2018 02:22
Show Gist options
  • Save bergpb/04cd40bc9c57b3cacde6e10cb1f3226c to your computer and use it in GitHub Desktop.
Save bergpb/04cd40bc9c57b3cacde6e10cb1f3226c to your computer and use it in GitHub Desktop.
Get ngrok public url in api with node.
//Execute with: node ngrok_url_api.js
const request = require("request");
const url = "http://127.0.0.1:4040/api/tunnels";
request.get(url, function(error, res, body) {
get_url = JSON.parse(body);
console.log(get_url.tunnels[0].public_url);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment