I am writing a function to return a value from a function I wrote to start the ngrok server. Is there any way for me to get public url?
This is the code I have:
const tunnel = async(args) => {
const url = await ngrok.connect(80);
console.log(url);
return url;
}
tunnel();
console.log(tunnel());
I am getting the result for the console.log
inside the function.
For when I console.log
for the return. I am getting this Promise { <pending> }
.
Can I get the url
value from inside the function outside it?