Skip to content

Instantly share code, notes, and snippets.

@alexcmgit
Created February 11, 2020 02:26
Show Gist options
  • Save alexcmgit/8c1056b4e8beec4217e405293e9c3cd6 to your computer and use it in GitHub Desktop.
Save alexcmgit/8c1056b4e8beec4217e405293e9c3cd6 to your computer and use it in GitHub Desktop.
index.js
if (process.env.DEVELOPMENT) {
const ngrok = require("ngrok");
(async function() {
try {
const url = await ngrok.connect({
proto: "http",
addr: process.env.PORT
});
console.log("Tunnel Created -> ");
console.log(url);
console.log("Tunnel Inspector -> http://127.0.0.1:4040");
} catch (error) {
console.log(error);
}
})();
}
.env
PORT=1111
USER=laks
PASS=laks123
DEVELOPMENT=isdev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment