Member-only story

Create and expose JSON APIs for rapid prototyping with no coding

pi314tech
4 min readFeb 23, 2024

--

Given the widespread use of SaaS apps, there’s often a need to swiftly prototype system integrations without exposing sensitive production endpoints. A common scenario is wanting to expose JSON API endpoints quickly, without relying on IT/operations/devops for DNS entries. In this article, we’ll explore a rapid solution for achieving these goals.

To begin, we’ll leverage ngrok to expose a local endpoint to the internet. This approach satisfies several requirements:

  • Immediate exposure without requiring devops/DNS assistance
  • Easy and public accessibility
  • Accessibility for a defined period (as long as ngrok is running), with the flexibility to be terminated or restarted as needed, unlike a static public endpoint.

While these steps are officially documented on the ngrok website, let’s do a a quick recap of ngrok setup:

  • Download the ngrok package compatible with your operating system.
  • Configure the ngrok auth token.
  • Start ngrok tunnel, specifying the local port to expose.

At this point, the local port has no active processes listening. Let’s go ahead and set up a process to serve the required JSON APIs on this local port.

For the second part, we require a way to expose a JSON endpoint without extensive coding. While options exist to create routes with logic using a Node.js…

--

--

pi314tech
pi314tech

Written by pi314tech

Technology enthusiast, lifelong learner, developer, photographer and travel blogger

No responses yet

Write a response