Returns any HTTP status code you want, as a simple http server
$ docker run -p 1500:1500 \
-e RESPONSE_HTTP_STATUS_CODE=503 \
-e LISTEN_PORT=1500 \
public.ecr.aws/toricls/http-hey-yo:latest
then, you'll see a simple HTTP server running.
2020-08-13T09:11:22+0000 RESPONSE_HTTP_STATUS_CODE: 503
2020-08-13T09:11:22+0000 LISTEN_PORT : 1500
2020-08-13T09:11:22+0000 HTTP server being ready
Let's curl it.
$ curl -i http://localhost:1500
HTTP/1.1 503 Service Unavailable
2020-08-13T08:58:39+0000 Hey, Yo!
$ curl -i http://localhost:1500/meaninglesspath
HTTP/1.1 503 Service Unavailable
2020-08-13T08:59:04+0000 Hey, Yo!
The default value is 200
. Set this value to change the HTTP response status code of http-hey-yo.
The default value is 8080
. Set this value to change the listen port number of http-hey-yo.
$ docker build -t YOUR-NAME/http-hey-yo .
$ docker push YOUR-NAME/http-hey-yo
- Fork (https://github.com/toricls/http-hey-yo/fork)
- Create a feature branch
- Commit your changes
- Rebase your local changes against the master branch
- Create a new Pull Request