refactoring
This commit is contained in:
parent
71b50b374b
commit
db3d2d8680
7
ngrok.js
7
ngrok.js
|
@ -43,6 +43,7 @@ fs.readFile(dotenvFile, "utf8", (err, data) => {
|
|||
const addr = options?.addr ? options.addr : 3000;
|
||||
|
||||
// Start ngrok
|
||||
try {
|
||||
const url = await ngrok.connect({ authtoken, proto, addr });
|
||||
|
||||
// Rebuild lines with the new url
|
||||
|
@ -66,9 +67,13 @@ fs.readFile(dotenvFile, "utf8", (err, data) => {
|
|||
return;
|
||||
}
|
||||
console.clear();
|
||||
console.log(`Started ngrok: protocol '${proto}', addr '${addr}'`)
|
||||
console.log(`Started ngrok: protocol '${proto}', addr '${addr}'`);
|
||||
console.log(`Your current ngrok url is ${url}.`);
|
||||
console.log(`Your .env file has been updated.`);
|
||||
});
|
||||
} catch (err) {
|
||||
console.error(err.message);
|
||||
process.exit(1);
|
||||
}
|
||||
})();
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue