Share your Localhost

As a developer, it would sometimes be easier if you could just show what you have on your local machine. You maybe wanna test it on a mobile or pad. Or you want to run it thru an awesome testing server etc.
There are many times where you want to test your local things before you push it to your repository.

This is actually so common that there is a service for this, it’s called ngrok.
Ngrok is available for all platforms ( Mac, Windows, Linux ) and really easy to use.

To use ngrok you download it run it on your local machine and it will provide you with a random url where you can reach it from anywhere, on any device.
That’s awesome, right?

To give you a technical description of what it does ( copied from ngrok help )

ngrok exposes local networked services behinds NATs and firewalls to the public internet over a secure tunnel. Share local websites, build/test webhook consumers and self-host personal services. Detailed help for each command is available with ‘ngrok help <command>’. Open http://localhost:4040 for ngrok’s web interface to inspect traffic.

All you need to do is run:

ngrok http 80

And it will take your localhost:80 and provide the random public url for it, both with http and https.

isn’t it great !

Ang btw, if your running Angular you need to serve your app with:

ng serve –disable-host-check

 

 

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *