Skip to content

Commit bb848e8

Browse files
committed
Instructions for overriding body with file content
1 parent fbb3bfa commit bb848e8

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

README.md

+11
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ This image is executed as non root by default and is fully compliant with Kubern
3333
- [Configuring CORS policy](#setting-corscross-origin-resource-sharing-headers-in-the-response)
3434
- [Client certificate details (mTLS) in the response](#client-certificate-details-mtls-in-the-response)
3535
- [Preserve the case of headers in response body](#preserve-the-case-of-headers-in-response-body)
36+
- [Override the response body with a file](#override-the-response-body-with-a-file)
3637
- [Prometheus Metrics](#prometheus-metrics)
3738
- [Screenshots](#screenshots)
3839
- [Building](#building)
@@ -287,6 +288,16 @@ By default, the headers in the response body are lowercased. To attempt to prese
287288
docker run -e PRESERVE_HEADER_CASE=true -p 8080:8080 -p 8443:8443 --rm -t mendhak/http-https-echo:33
288289
```
289290

291+
## Override the response body with a file
292+
293+
To override the response body with a file, set the environment variable `OVERRIDE_RESPONSE_BODY_FILE_PATH` to a file path.
294+
The file path needs to be in the `/app` directory.
295+
296+
```bash
297+
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
298+
```
299+
300+
290301
## Prometheus Metrics
291302

292303
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

0 commit comments

Comments
 (0)