jonas_jones-api/src/main.rs
2023-12-03 18:41:02 +01:00

22 lines
494 B
Rust

use warp::Filter;
#[tokio::main(flavor = "current_thread")]
async fn main() {
// GET /hello/warp => 200 OK with body "Hello, warp!"
let hello = warp::path!("hello" / String)
.map(|name| format!("Hello, {}!", name));
let root = warp::path::end()
.map(|| "Hello, World!");
let routes = hello.or(root);
warp::serve(routes)
.run(([127, 0, 0, 1], 3030))
.await;
warp::serve(routes)
.run(([192,168,0,55], 3030))
.await;
}