rh
is a CLI tool for creating an ephemeral endpoint for testing and inspecting requests from your application or webhook.
brew install aaronvb/request_hole/rh
First make sure you have Go installed: https://golang.org/doc/install
git clone [email protected]:aaronvb/request_hole.git
cd request_hole
go build -o $GOBIN/rh
Download the release version for your system: https://github.com/aaronvb/request_hole/releases
$ rh
rh: Request Hole
This CLI tool will let you create a temporary API endpoint for testing purposes.
Usage:
rh [command]
Available Commands:
help Help about any command
http Creates an http endpoint
version Print version number of Request Hole
Flags:
-a, --address string sets the address for the endpoint (default "localhost")
--details shows header details in the request
-h, --help help for rh
--log string writes incoming requests to the specified log file (example: --log rh.log)
-p, --port int sets the port for the endpoint (default 8080)
-r, --response_code int sets the response code (default 200)
Use "rh [command] --help" for more information about a command.
To create an http endpoint with default settings (port 8080, return status code 200):
$ rh http
This option shows all the header details in the incoming request.
$ rh http --details
This option will write the CLI output to the specified log file. Works with other options such as --details
.
$ rh http --log rh.log
Sometimes we need to expose rh
to the internet to test applications or webhooks from outside of our local dev env. The best way to do this is to use a tunneling service such as ngrok.
$ ngrok http 3001
$ rh http -p 3001