Skip to content

Commit

Permalink
Instructions for overriding body with file content
Browse files Browse the repository at this point in the history
  • Loading branch information
mendhak committed Aug 11, 2024
1 parent fbb3bfa commit bb848e8
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ This image is executed as non root by default and is fully compliant with Kubern
- [Configuring CORS policy](#setting-corscross-origin-resource-sharing-headers-in-the-response)
- [Client certificate details (mTLS) in the response](#client-certificate-details-mtls-in-the-response)
- [Preserve the case of headers in response body](#preserve-the-case-of-headers-in-response-body)
- [Override the response body with a file](#override-the-response-body-with-a-file)
- [Prometheus Metrics](#prometheus-metrics)
- [Screenshots](#screenshots)
- [Building](#building)
Expand Down Expand Up @@ -287,6 +288,16 @@ By default, the headers in the response body are lowercased. To attempt to prese
docker run -e PRESERVE_HEADER_CASE=true -p 8080:8080 -p 8443:8443 --rm -t mendhak/http-https-echo:33
```

## Override the response body with a file

To override the response body with a file, set the environment variable `OVERRIDE_RESPONSE_BODY_FILE_PATH` to a file path.
The file path needs to be in the `/app` directory.

```bash
docker run -d --rm -v ${PWD}/test.html:/app/test.html -p 8080:8080 -e OVERRIDE_RESPONSE_BODY_FILE_PATH=/test.html -t mendhak/http-https-echo:33
```


## Prometheus Metrics

To expose http performance metrics, set the `PROMETHEUS_ENABLED` environment variable to true, the metrics will be available at `/metrics`. This uses the [`express-prom-bundle`](https://github.com/jochen-schweizer/express-prom-bundle) middleware
Expand Down

0 comments on commit bb848e8

Please sign in to comment.