Skip to content

Commit ff3d867

Browse files
committed
add hello-world-actix-web benchmark
1 parent 6d6aaa6 commit ff3d867

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

benchmark/Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
[workspace]
22

3-
members = []
3+
members = [
4+
"hello-world/actix-web",
5+
]
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[package]
2+
name = "hello-world-actix-web"
3+
version = "0.1.0"
4+
authors = ["smallfish <[email protected]>"]
5+
edition = "2021"
6+
7+
[dependencies]
8+
actix-web = "3"
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
use actix_web::{web, App, HttpServer};
2+
3+
#[actix_web::main]
4+
async fn main() -> std::io::Result<()> {
5+
HttpServer::new(|| App::new().service(web::resource("/").to(index)))
6+
.bind("127.0.0.1:3000")?
7+
.run()
8+
.await
9+
}
10+
11+
async fn index() -> &'static str {
12+
"Hello, World!"
13+
}

0 commit comments

Comments
 (0)