1
1
Fork
You've already forked echo-server
0
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%
2025年01月04日 10:13:00 +02:00
chart renamed chart directory 2024年01月31日 14:17:52 +00:00
Dockerfile added readme, bind address configuration and adjusted output format handling 2023年04月10日 12:48:11 +03:00
Jenkinsfile refactor variables and multi tagging 2025年01月04日 10:13:00 +02:00
LICENSE add license 2024年01月14日 21:12:09 +00:00
main.py added readme, bind address configuration and adjusted output format handling 2023年04月10日 12:48:11 +03:00
README.md fixed typos in build command 2023年04月11日 16:17:45 +03:00
requirements.txt bumped flsak version and work on test stage in jenkinsfi 2024年01月13日 00:08:02 +00:00

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"
}