feat: add warp
This commit is contained in:
13
warp/src/main.rs
Normal file
13
warp/src/main.rs
Normal file
@@ -0,0 +1,13 @@
|
||||
use warp::Filter;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
// GET /hello/warp => 200 OK with body "Hello, warp!"
|
||||
let hello = warp::path!("hello" / String)
|
||||
.map(|name| format!("Hello, {}!", name));
|
||||
|
||||
warp::serve(hello)
|
||||
.run(([127, 0, 0, 1], 8080))
|
||||
.await;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user