2023-10-11 20:23:13 +02:00
|
|
|
use axum::{routing::get, Router};
|
|
|
|
|
|
|
|
#[tokio::main]
|
|
|
|
async fn main() {
|
|
|
|
// build our application with a single route
|
|
|
|
let app = Router::new().route("/", get(|| async { "Hello, World!" }));
|
|
|
|
|
|
|
|
// run it with hyper on localhost:3000
|
|
|
|
axum::Server::bind(&"0.0.0.0:3000".parse().unwrap())
|
|
|
|
.serve(app.into_make_service())
|
|
|
|
.await
|
|
|
|
.unwrap();
|
2023-10-11 20:12:24 +02:00
|
|
|
}
|