https://github.com/josecelano/rust-sleep
Minimal Rust HTTP server to test timeouts
https://github.com/josecelano/rust-sleep
Last synced: 2 months ago
JSON representation
Minimal Rust HTTP server to test timeouts
- Host: GitHub
- URL: https://github.com/josecelano/rust-sleep
- Owner: josecelano
- Created: 2024-02-02T14:12:52.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-02-02T14:14:33.000Z (over 1 year ago)
- Last Synced: 2025-03-24T03:56:23.664Z (2 months ago)
- Language: Rust
- Size: 9.77 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Minimal Rust HTTP server
To test timeouts.
```console
$ cargo run
Compiling rust-sleep v0.1.0 (/tmp/rust-sleep)
Finished dev [unoptimized + debuginfo] target(s) in 0.81s
Running `target/debug/rust-sleep`
2024-02-02T14:11:26.929532863+00:00 [warp::server][INFO] Server::run; addr=0.0.0.0:3030
2024-02-02T14:11:26.929618913+00:00 [warp::server][INFO] listening on http://0.0.0.0:3030
2024-02-02T14:11:29.452928776+00:00 [rust_sleep][INFO] Received a request to sleep
2024-02-02T14:11:34.453121450+00:00 [api_server][INFO] 127.0.0.1:51216 "GET /sleep HTTP/1.1" 200 "-" "curl/7.88.1" 5.000205534s
``````console
$ curl -i http://127.0.0.1:3030/sleep
HTTP/1.1 200 OK
content-type: text/plain; charset=utf-8
content-length: 5
date: Fri, 02 Feb 2024 14:11:29 GMT
```