Crates.io | trillium-send-file |
lib.rs | trillium-send-file |
version | 0.1.0 |
source | src |
created_at | 2021-10-09 18:24:37.441541 |
updated_at | 2021-10-09 18:24:37.441541 |
description | send file for trillium.rs |
homepage | |
repository | https://github.com/prabirshrestha/trillium-send-file |
max_upload_size | |
id | 462872 |
size | 21,604 |
Send file connection extension for trillium.rs.
[dependencies]
trillium = "0.2.0"
trillium-smol = "0.2.0"
trillium-send-file = { version = "0.1.0", features = ["smol"] }
Use features = ["async-std"]
for async-std runtime.
use trillium::Conn;
use trillium_send_file::SendFileConnExt;
fn main() {
trillium_smol::run(|conn: Conn| async move {
conn.send_file("/tmp/file.txt".into()).await
});
}