Skip to content

ngrok-samples/javascript-quickstart

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ngrok JavaScript SDK Quickstart

A minimal Node.js app demonstrating the ngrok JavaScript SDK.

What you'll need

Setup

  1. Install dependencies:

    npm install
  2. Create a .env file from the example:

    cp .env.example .env
  3. Add your ngrok auth token to the .env file:

    NGROK_AUTHTOKEN=your_actual_authtoken_here
  4. Reserve a domain in the ngrok dashboard and add it to the .env file:

    NGROK_RESERVED_DOMAIN=your_actual_domain_here

Running the app

  1. Start the Node.js service:

    npm run service
  2. In another terminal, start the ngrok agent endpoint:

    npm run endpoint

The ngrok agent endpoint will output a URL that forwards traffic to your local app.

Files

  • service.js - Basic Node.js HTTP server
  • endpoint.js - ngrok agent endpoint configuration with OAuth
  • .env.example - Environment variable template

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •