Using ngrok and Node.js with Oracle APEX
In this article, I'll show you how to use node js and ngrok with Oracle APEX. In today's tech landscape, the demand for efficient integration between various platform and systems is higher than ever. Oracle APEX Application Express offers a powerful framework for building web applications that interact with Oracle Database. However, when it comes to integrating APEX Applications with external services or API's, developers often seek flexible solutions that streamline the process.
Introducing Node.js and Ngrok
- Node.js — Node.js is a runtime environment built on Chrome's V8 JavaScript engine. It has gained widespread popularity for developing server-side applications. Its non-blocking, event-drive architecture which makes it well suited for handling asynchronous operations, such as HTTP requests and Interacting with databases.
- Ngrok — Ngrok is a powerful tool that creates secure tunnels to localhost, allowing developers to expose local servers to the internet. Ngrok combines your reverse proxy, firewall, API gateway, and global load balancing to deliver apps and APIs. This capability is particularly useful during development and testing phases when working with APIs that need to be accessed externally.
Building RESTFul API with Node.js
To create RESTFul APIs for Oracle APEX consumption using Node.js, developers can follow these steps:
- The first thing to do is to access Node.js's official website:
The website is highly intelligent enough to automatically detect your operating system. Install Node.js and npm (Node Package Manager) on your development machine.
- Sign up with Ngrok for a free or paid account on their website ngrok.com. After signing up, you'll receive a confirmation email.

- Download Ngrok once you have confirmed your account. Log in to Ngrok's website and then navigate to Setup & Installation section and download the Ngrok executable file appropriate for your operating system.

- Extract the zip file to a location on your computer where you want to keep Ngrok if you have downloaded Ngrok as a zip file.

- Ngrok requires an authentication token for usage. You can find your authentication token on the Ngrok dashboard after logging in.

- To set up your authentication token, open a terminal or command prompt, navigate to the directory where you extracted Ngrok and run the following command you copied. Now, you can use Ngrok by running the executable from the terminal or command prompt to expose a local web server running on your personal device.

- To expose your local web server running on port 8080, you would run
ngrok http 8080via your terminal or command prompt. Congratulations! Ngrok is now installed and ready to use on your system. Remember, the Ngrok executable needs to be running in the terminal or command prompt for the tunnel to stay active.
Consuming RESTful APIs Developed with Node.js in Oracle APEX
With RESTful API exposed via Ngrok, integrating it into Oracle APEX is straightforward. follow these steps:
- Understand the API: Before you start consuming the API, make sure you understand its endpoint, request methods, authentication requirements (if any) and the expected response format.
- Create a Web Source Module: In Oracle APEX, you can use the Web Source Module feature to consume external APIs. Go to the Shared components section, under Data Sources, click Rest Data Sources to create a new REST Data Source.

- Configure a Web Source Module:Click create to open the create REST Data Source dialog page to provide your details.

