What is Ngrok?
It is a utility which exposes your localhost over web.So that would mean you can actually use ngrok provided dns to access your local code, which can make your life easier when your application is server in mobile devices, I know there are other ways to achieve this but this is the most simplest solution I have found , So thought to share it with you guys!
First of all you need to download Ngrok cli from following link:
NGROK DOWNLOAD Follow Instructions.
Now Once your have downloaded, navigate to the folder where your have extracted ngrok
write ./ngrok help or ngrok help
Now using a simple command to expose your localhost to web.
./ngrok http port_number
You will see something like this.
Your web url will be:
http://c49d74c7.ngrok.io copy and paste in your browser or just use the same in any device to view your application online.
Open the web interface at http://localhost:4040 to inspect and replay requests.
Ngrok by default will tunnel your application in US region, which can be changed using option –region region_code. Such as following:
- us – United States (Ohio)
- eu – Europe (Frankfurt)
- ap – Asia/Pacific (Singapore)
- au – Australia (Sydney)
For More advance feature and setting custom subdomains and more please click here.