Today I want to introduce you to a very handy tool for developers called ngrok. Have you ever been developing something locally and wanted to show your website, API or chatbot to a colleague or expose it to the world wide web? Usually development machines do not have static IPs and even if the do, it is usually a big hassle and also a security risk to open up ports. So we always had to push our software to some production or test server. That is fine for some use cases but a huge waste of time if you just want to test something quickly.
ngrok temporarily assigns a DNS name to a specified port on your local machine. It does this by creating a secure tunnel between the endpoint defined by the DNS entry and your local machine. Voila, you can now show your awesome chatbot in development to your friends by hooking it up to Slack for example.
Usage is quite simple. Just download ngrok from the official website https://ngrok.com/, fire up a terminal and type ./ngrok http <port> with the port on localhost that you want to expose.
In the example above, localhost:3000 is now available under https://katesapp.ngrok.io.