Skip to content

Commit 6bd33a6

Browse files
authored
Update README.md
1 parent 1d32258 commit 6bd33a6

File tree

1 file changed

+46
-1
lines changed

1 file changed

+46
-1
lines changed

README.md

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
# Request Hole CLI
22
[![go.dev Reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=flat)](https://pkg.go.dev/github.com/aaronvb/request_hole)
3-
[![Test](https://github.com/aaronvb/request_hole/workflows/Test/badge.svg)](https://github.com/aaronvb/request_hole/actions/workflows/tests.yml)
3+
[![Go Tests](https://github.com/aaronvb/request_hole/workflows/Test%20Go/badge.svg)](https://github.com/aaronvb/request_hole/actions/workflows/test_go.yml)
4+
[![JS Tests](https://github.com/aaronvb/request_hole/workflows/Test%20JS/badge.svg)](https://github.com/aaronvb/request_hole/actions/workflows/test_js.yml)
45
[![Builds](https://github.com/aaronvb/request_hole/workflows/Builds/badge.svg)](https://github.com/aaronvb/request_hole/actions/workflows/builds.yml)
56

67
`rh` is a CLI tool for creating an ephemeral endpoint for testing and inspecting requests from your application or webhook.
78

9+
<img width="1136" alt="Request Hole CLI web ui" src="https://user-images.githubusercontent.com/100900/125158715-9b866500-e10e-11eb-9438-36d0f8325c60.png">
810
<img width="788" alt="Request Hole CLI" src="https://user-images.githubusercontent.com/100900/120265767-63048900-c23c-11eb-9a20-079ab9822767.png">
911

1012

@@ -48,10 +50,21 @@ Flags:
4850
--log string writes incoming requests to the specified log file (example: --log rh.log)
4951
-p, --port int sets the port for the endpoint (default 8080)
5052
-r, --response_code int sets the response code (default 200)
53+
--web runs a web server to show incoming requests
54+
--web_port int sets the port for the web server (default 8081)
5155
5256
Use "rh [command] --help" for more information about a command.
5357
```
58+
## Using the Web UI
59+
### Create an HTTP endpoint
60+
```
61+
$ rh http --web
62+
```
63+
This option will open a web UI that will display the incoming requests. Incoming requests will render live in the browser when they are received.
5464

65+
<img width="1136" alt="Request Hole CLI web ui" src="https://user-images.githubusercontent.com/100900/125158715-9b866500-e10e-11eb-9438-36d0f8325c60.png">
66+
67+
## Using the CLI
5568
### Creating an HTTP endpoint
5669
To create an http endpoint with default settings (port 8080, return status code 200):
5770
```
@@ -79,3 +92,35 @@ Sometimes we need to expose `rh` to the internet to test applications or webhook
7992
$ ngrok http 3001
8093
$ rh http -p 3001
8194
```
95+
96+
## Running Tests and Building
97+
It is recommended to run the JS build first so that the Go build can embed the latest web UI build.
98+
99+
### CLI
100+
```
101+
$ go test -v ./...
102+
$ go build
103+
```
104+
105+
### Web UI
106+
```
107+
$ cd web; yarn test
108+
$ cd web; yarn build
109+
```
110+
#### For Development
111+
```
112+
$ cd web; yarn start
113+
```
114+
Visit `localhost:3000`
115+
116+
## Built With
117+
- Go https://golang.org/
118+
- logparams https://github.com/aaronvb/logparams
119+
- logrequest https://github.com/aaronvb/logrequest
120+
- cobra https://github.com/spf13/cobra
121+
- gqlgen https://github.com/99designs/gqlgen (GraphQL/Websockets)
122+
- gorilla/mux https://github.com/gorilla/mux
123+
- Apollo https://github.com/apollographql/apollo-client (GraphQL frontend)
124+
- create-react-app https://github.com/facebook/create-react-app
125+
- Tailwind https://github.com/tailwindlabs/tailwindcss
126+
- React Testing Library https://github.com/testing-library/react-testing-library

0 commit comments

Comments
 (0)