Hi,
I Just want to share details about a very useful tool, I really liked it and may be you’ll also like it.
Lets say i have a Restful service(example webapi code) in my PC , i am running it on port 4000.
So something like http://localhost:4000/getEmployeeDetails
will display my employee details.
Now I want these services to be used instantly by some mobile app or someone through the internet for testing.
First of all, I don’t have a domain or server to host my service and expose it over the internet even for testing.
Now what I can do is I can download an exe provided by ngrok
https://ngrok.com/
You can simply download the zip file and unzip where ever we want in our file system.
Let’s say I unzipped it in C:\Sotwares folder
And now from command prompt execute the following command.
Now follow these steps:
- Open the command prompt and execute the following command.
- So let’s say our API is exposed through port 4000. That is when I browse http://localhost:4000/getEmployeeDetails,
- I’ll get employee details.
- I need to execute below commands
cd C:\Softwares
ngrok http 4000
- Now it will provide you with an URL like http://abcfdd.ngrok.io Now I can give this URL to someone and they can access it through the internet.
So to access my Employee service hosted on my local machine I need to simply give http://abcfdd.ngrok.io/getEmployeeDetails
This really helps us to quickly do some testing.
Keywords: Ngrok, Tunnelling
Thanks,
Pavan