A simple Python/Flask based webserver that echos back any incoming requests.
https://hub.docker.com/r/maze88/echo-server
- Smarty 50.8%
- Python 43.8%
- Dockerfile 5.4%
| chart | renamed chart directory | |
| Dockerfile | added readme, bind address configuration and adjusted output format handling | |
| Jenkinsfile | refactor variables and multi tagging | |
| LICENSE | add license | |
| main.py | added readme, bind address configuration and adjusted output format handling | |
| README.md | fixed typos in build command | |
| requirements.txt | bumped flsak version and work on test stage in jenkinsfi | |
Echo Server
A simple Python/Flask based webserver that echos back any incoming requests.
Build
docker build -t echo-server:latest .
Configuration (Environment variables)
| Variable name | Default value | Description |
|---|---|---|
BIND_ADDRESS |
0.0.0.0 |
Which host address to listen on. |
OUTPUT |
json |
The format to return HTTP responses. Can be JSON or YAML. |
Run
docker run --rm -d -p 5000:5000 echo-server:latest
Example query
curl -X POST 'http://localhost:5000/some/path/test?my_key=a_value&foo=bar' -d 'hello world' | jq
Should return:
{
"args": {
"foo": "bar",
"my_key": "a_value"
},
"client_ip": "172.17.0.1",
"data": "hello world",
"headers": {
"Accept": "*/*",
"Content-Length": "11",
"Content-Type": "application/x-www-form-urlencoded",
"Host": "localhost:5000",
"User-Agent": "curl/7.74.0"
},
"method": "POST",
"response_time": 0.0002567768096923828,
"timestamp": "2023年04月10日 09:45:49.595615",
"uri": "/some/path/test"
}