This project is a simple HTTP server that echoes back request information. It is useful for testing and debugging deployments and networking configurations by providing a simple interface to inspect requests.
The HTTP Echo server provides the following features:
- Accepts HTTP methods GET,POST,PUT,PATCHandDELETE.
- Echoes back request information in jsonformat:- host: hostnameandip
- headers: request headers
- queries: query parameters
- params: path parameters
- body: request body
 
- host: 
- Returns a custom status code for a request (provided via query).
- E.g. http://127.0.0.1:3000/?status=404returns a404response code.
 
- E.g. 
- Exports metrics in prometheusformat for monitoring.
The server accepts the following parameters:
- -listen: the address to listen on (default:- :3000)
- -metrics: the path to expose metrics on (default:- /metrics)
You can run the server using via the following methods:
Yuu can run the server locally using the following command:
# execute via go run
$ go run cmd/server/main.go
# or build and execute
$ go build -o htt-echo cmd/server/main.go
$ ./http-echoThere is also a docker image available on Docker Hub.
# run using docker
$ docker run -p 3000:3000 rellyson/http-echo:latestThis project is licensed under the MIT License - see the LICENSE file for details.
