Giter Club home page Giter Club logo

ngrok-custom-html-error-page's Introduction

ngrok-custom-html-error-page

This is a simple example in Bash Script, of using the ngrok API to generate Custom Error messages.

In some situations developer might want to change the default error message displayed when the ngrok agent is not running, or they do not want their Users to know that they are using ngrok.

This simple example will upload a HTML Error Page to ngrok, and register the page with an ngrok HTML Edge in this example.

Prerequisites

You will need a Bash Shell and make sure jq and curl is installed for this Bash Script to work.

How do I run this

First you need to obtain your API Key from your ngrok Dashboard: https://dashboard.ngrok.com/api

Then you need to set an Environment Variable to the ngork API Key value. You can simply export the value like so from the Shell: export NGROK_API_KEY [yourKey]

Create a new HTML Edge in the ngrok Dashboard or from the API, and obtain the Edge ID. In the ngrok dashboard there is a shortcut that will copy the value to your Clipboard in your Browser:

image

./customHtml.sh edghts_2UiGMp2tx4F4MZqlZ8tMRvbzgzH ./index.html

Assuming you cloned the Repo., and ran the script, if you browse to the Domain assigned to your Edge, and the ngrok Agent is not running, you should see the Custom HTML Error page from this repo.

Final Thoughts

This is a simple REST API request, so you can run it from almost any backend. Since there are not many examples of this on the Web, I kept the example very simple, and just used very simple tools.

If you want to see other examples or have any questions about this, feel free to reach out to me.

[email protected]

ngrok-custom-html-error-page's People

Contributors

ngrok-patrick avatar

Stargazers

Fred Loucks avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.