Exposing your local application to the world with Tunnels

In this tutorial, we will show how you can use Onboardbase Tunnels to expose an application running on your local machine to the internet.

This can be useful if you need to share what you are working on for others to interact with and review, like for a quick demo. You can also use tunneling when a remote service needs to talk to the service you are working on, and you don't want to deploy the local service yet.

To create a tunnel to your application running locally, you must ensure you have the Onboardbase CLI installed. You can find instructions on how to install the Onboardbase CLI here.

Creating a Tunnel With Onboardbase

To demonstrate tunnel creation with Onboardbase, we will use a straightforward NodeJS Express server.

You can clone the repository here:

git clone https://github.com/Onboardbase/tutorials-tunneling-nodejs.git

After cloning the code, run npm install or yarn install to install the dependencies. The index.js is a straightforward express application:

const express = require("express");
const app = express();

app.get("/", (req, res) => {
  res.send("GET request to the homepage");
});

const port = 3000;
app.listen(port, () => {
  console.log(`Example app listening on port ${port}`);
});

To start the application, run yarn startthis should start the application on port 3000

Onboardbase Tunnel

To create a tunnel to the Express Server running on port 3000, run the following command.

onboardbase tunnels:create -p 3000 -s simple-express

The -p flag indicates the Port that your application is running locally, and the -s flag indicates the name of the subdomain to use for the public URL. You can learn more about Onboardbase Tunnels here.

This should output a URL:

The URL will be different depending on the value you provided to the -s flag. If you also supply the -o flag, the URL will automatically open in a web browser.

You can run onboardbase tunnels:create -p 3000 -s simple-express -o in another terminal window

Notice that since the simple-express subdomain was already taken, Onboardbase automatically appends some text to the name so that it is unique.