Add warp & tokio

main
Charlotte Som 2021-12-30 17:39:03 +00:00
parent 74d8634397
commit 33674eec78
3 changed files with 1024 additions and 2 deletions

1016
Cargo.lock generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -5,3 +5,5 @@ edition = "2021"
authors = ["charlotte ✨ <charlotte@lavender.software>"] authors = ["charlotte ✨ <charlotte@lavender.software>"]
[dependencies] [dependencies]
tokio = { version = "1.15.0", features = ["full"] }
warp = "0.3.2"

View File

@ -1,3 +1,7 @@
fn main() { use warp::Filter;
println!("Hello, world!");
#[tokio::main]
async fn main() {
let hello = warp::any().map(|| "Hello!".to_string());
warp::serve(hello).bind(([127, 0, 0, 1], 8000)).await;
} }