Exposing localhost api

A few days ago, I want to show the progress of an ongoing web application to a product owner who is not in the office. But I want him to play with the new feature and send some feedback as we developed. One of my colleagues introduces a couple of tools to me that serve this purpose.

These tools come in handy when anyone wants to spin up a test API in a few minutes and be able to expose it to the world

Table of Contents

localtunnel

To expose this to the world, install localtunnel

Using localtunnel (https://localtunnel.github.io/www)

npm install -g localtunnel

Then on the command line

lt --port xxxx --subdoman whateverfanciesyou

ngrok

Download the binary from https://ngrok.com/

On the command line

ngrok http {{portnumber}}

where xxxx is the port you want to listen to. I find ngrok to have a more consistent behaviour

Tutorials

Arvin has created a github repo. He created a simple api using Node and Express and describe the steps to expose the api to outside world. Moreover, you can also use ngrok with Windows and Visual Studio to test webhooks

I would like to hear your thoughts