Have you ever wondered how do you test the node app on your mobile or how do you give a sneak peek to your fellow friend, colleague to see it, without deploying it? Well, it is possible and in this article I will explain how to do it.
Ngrok is a tool which will allow you to expose your localhost to the world. Head down to their website download page and download it.
The installation depends on your environment, they have very clear documentation in the download page, so just make sure to follow their instructions.
In my case I could access my app on this url:
http://localhost:3000
So my app’s port number is 3000
Make sure that your app is running, open a new console window and type in:
ngrok http 3000
Instead of 3000 type in the port number that your app is running on.
Now as you can see you have a URL for your app! In my case it is http://3b11c268.ngrok.io/.
Go to this URL and you will see your app! Also you get the second link, in which you can test your app with a HTTPS connection!
So there you have it! You can now show your local app to your friends or test it on any device with an internet connection!