Skip to content

Commit a7360d2

Browse files
committed
add hello-world-axum benchmark
1 parent ff3d867 commit a7360d2

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

Diff for: benchmark/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22

33
members = [
44
"hello-world/actix-web",
5+
"hello-world/axum",
56
]

Diff for: benchmark/hello-world/axum/Cargo.toml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[package]
2+
name = "hello-world-axum"
3+
version = "0.1.0"
4+
edition = "2021"
5+
6+
[dependencies]
7+
axum = "0.3"
8+
tokio = { version = "1", features = ["full"] }

Diff for: benchmark/hello-world/axum/src/main.rs

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
use axum::{routing::get, Router};
2+
3+
#[tokio::main]
4+
async fn main() {
5+
let app = Router::new().route("/", get(|| async { "Hello, World!" }));
6+
7+
axum::Server::bind(&"127.0.0.1:3000".parse().unwrap())
8+
.serve(app.into_make_service())
9+
.await
10+
.unwrap();
11+
}

0 commit comments

Comments
 (0)