| Crates.io | tubetti |
| lib.rs | tubetti |
| version | 0.3.1 |
| created_at | 2025-02-15 01:29:34.258962+00 |
| updated_at | 2025-05-18 20:04:48.16744+00 |
| description | Serve &[u8] data at a localhost url with minimal configuration |
| homepage | |
| repository | https://github.com/molenick/tubetti |
| max_upload_size | |
| id | 1556179 |
| size | 68,159 |
No-fuss, low configuration webservers on demand
use tubetti::tube;
let body = std::sync::Arc::new("potatoes".as_bytes());
let tb = tube!(body).await.unwrap();
let client = reqwest::Client::new();
let response = client.get(tb.url()).send().await.unwrap();
assert_eq!(response.headers().get("accept-ranges").unwrap(), "bytes");
assert_eq!(response.headers().get("content-length").unwrap(), "8");
assert_eq!(response.bytes().await.unwrap(), "potatoes".as_bytes());
tb.shutdown().await.unwrap();
Please take a look at the examples for more detailed usage information.
MIT OR Apache-2.0