Crates.io | echo-rs |
lib.rs | echo-rs |
version | 0.2.0 |
source | src |
created_at | 2023-06-09 22:00:17.162208 |
updated_at | 2023-06-29 20:38:32.631137 |
description | A simple HTTP echo server |
homepage | https://github.com/the-wondersmith/echo-rs |
repository | https://github.com/the-wondersmith/echo-rs |
max_upload_size | |
id | 886600 |
size | 93,120 |
echo-rs
provides a dead-simple HTTP echo server - i.e. it simply
parrots back any request it receives in a developer-friendly JSON-serialized
format.
It aims to provide a simple and convenient utility to assist in designing new applications, developing / testing API clients, or as a "dummy" workload for use in scaffolding new Kubernetes / cloud-native services.
echo-rs
provides:
A simple HTTP echo server, returning a JSON-serialized representation of any request made to it
Prometheus metrics (helpful when using echo-rs
as a dummy workload when designing new Kubernetes services)
Run the server locally -
docker run -it -p 8080:8080 --rm docker.io/thewondersmith/echo-rs:latest --metrics=false --log-level=debug
Then make a request to it with any HTTP client -
curl -X POST \
"http://localhost:8080/some/super-cool/endpoint?param1=some-param-value¶m2=another-param-value" \
-H 'Content-Type: application/json' \
-H 'App-Specific-Header: app_specific_value' \
-d '{"target": "echo-rs", "expected": "response", "some": ["more", "none", null], "nested": {"turtles": {"all": {"the": {"way": "down"}}}}}'
echo-rs
should return the JSON-serialized representation of the request -
{
"method": "POST",
"path": "/some/super-cool/endpoint",
"headers": {
"user-agent": "curl/7.87.0",
"host": "localhost:8080",
"accept": "*/*",
"content-type": "application/json",
"app-specific-header": "app_specific_value",
"content-length": "135"
},
"params": {
"param1": "some-param-value",
"param2": "another-param-value"
},
"body": {
"expected": "response",
"nested": {
"turtles": {
"all": {
"the": {
"way": "down"
}
}
}
},
"some": [
"more",
"none",
null
],
"target": "echo-rs"
}
}