Update README

This commit is contained in:
Fabricio 2021-02-24 09:35:10 -03:00
parent 2e4b06c595
commit 71e2d6b2e6

View file

@ -1,6 +1,6 @@
**Capture** is a reverse proxy that takes an incoming HTTP request and sends it to another server,
proxying the response back to the client, while showing them in a dashboard
proxying the response back to the client, while showing them in a dashboard.
[![Build Status](https://github.com/ofabricio/capture/workflows/build/badge.svg)](https://github.com/ofabricio/capture/actions?query=workflow%3Abuild)
[![Github Release](https://img.shields.io/github/release/ofabricio/capture.svg)](https://github.com/ofabricio/capture/releases)
@ -26,7 +26,7 @@ proxying the response back to the client, while showing them in a dashboard
If you set your base url as `http://example.com/api`, now `http://localhost:9000` points to that
address. Hence, calling `http://localhost:9000/users/1` is like calling `http://example.com/api/users/1`
*Capture* saves all requests and responses so that you can see them in the dashboard
*Capture* saves all requests and responses so that you can see them in the dashboard.
## Dashboard
@ -52,9 +52,9 @@ Via docker:
cd capture
docker run --rm -v $(pwd):/src -w /src -e GOOS=darwin -e GOARCH=amd64 golang:alpine go build -o capture
Now you have an executable binary in your directory
Now you have an executable binary in your directory.
**Note:** you can change `GOOS=darwin` to `linux` or `windows` to create an executable for your corresponding Operating System
**Note:** change `GOOS=darwin` to `linux` or `windows` to create an executable for your corresponding Operating System.
## Plugins
@ -65,8 +65,8 @@ Plugins must export the following function:
```go
func Handler(proxy http.HandlerFunc) http.HandlerFunc {
return func(rw http.ResponseWriter, r *http.Request) {
proxy.ServeHTTP(rw, r)
return func(w http.ResponseWriter, r *http.Request) {
proxy(w, r)
}
}
```