Ngrok Rock! A WordPress based API.
While attending a hackathon at Google’s San Francisco office, Chrome’s product manager introduced me to a tool called ngrok. He was using it to demo code running on his laptop from his phone.
ngrok instantly gives you a domain for anything running on your local machine. It’s amazing, and I instantly fell in love.
Professional I’ve used ngrok to give stakeholders access to code running on my local machine. You can easily share a link then they’re looking at the same thing you are.
Personally I’ve been using it as an “API” for my Raspberry PI. Instead of developing a real API by making the PI available outside of my home network using port forwarding, I decided to create a web interface and make it available remotely using ngrok. This required very little work and it worked out great. You just visit the domain ngrok gives you then you’re tunneled to a web server running on your PI!
There’s one downside to this approach though. ngrok domains are randomly generated so you either have to keep ngrok open permanently, manually type these random domains, or send yourself an email so you can click the link. For my project I used a third-party ngrok Node.js module, so every time I start the app it automatically creates an ngrok tunnel. This is great, but it also means that every time I close the app it closes the tunnel. I found myself checking the app every morning before I left to make sure I had the correct ngrok domain. This was a problem for me, mostly because I’m lazy.
Like everything I make, I made this because I had a need for it.
So I created Ngrok Rock! Ngrok Rock is a REST API built for storing ngrok domains. Using the ngrokrock command line client, ngrok domains will automatically be uploaded to ngrokrock.com. Then you can go to the website to see a list of active tunnels.
Check it out and let me know what you think! The site is available here:
Built using the WordPress REST API and Docker. The command line client can be found here:
Built using Node.js, you can find the source for it on GitHub.