Skip to content

Commit 0c80826

Browse files
committed
Rust axum fixes
1 parent a48e30d commit 0c80826

File tree

4 files changed

+10
-18
lines changed

4 files changed

+10
-18
lines changed

frameworks/Rust/axum/axum-mongo.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ FROM rust:1.55-slim-buster
33
ENV AXUM_TECHEMPOWER_MONGODB_URL=mongodb://tfb-database:27017
44

55
RUN apt-get update && apt-get install -y --no-install-recommends \
6-
libpq-dev pkg-config libssl-dev \
6+
pkg-config libssl-dev \
77
&& rm -rf /var/lib/apt/lists/*
88

99
WORKDIR /axum

frameworks/Rust/axum/axum.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
FROM rust:1.55-slim-buster
22

33
RUN apt-get update && apt-get install -y --no-install-recommends \
4-
libpq-dev pkg-config libssl-dev \
4+
pkg-config libssl-dev \
55
&& rm -rf /var/lib/apt/lists/*
66

77
WORKDIR /axum

frameworks/Rust/axum/benchmark_config.json

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,14 @@
55
"default": {
66
"json_url": "/json",
77
"plaintext_url": "/plaintext",
8-
"db_url": "/db",
9-
"fortune_url": "/fortunes",
10-
"query_url": "/queries?queries=",
11-
"update_url": "/updates?queries=",
128
"port": 8000,
139
"approach": "Realistic",
14-
"classification": "Fullstack",
15-
"database": "postgres",
10+
"classification": "Platform",
11+
"database": "none",
1612
"framework": "Axum",
1713
"language": "Rust",
1814
"flavor": "None",
19-
"orm": "Full",
15+
"orm": "Raw",
2016
"platform": "Rust",
2117
"webserver": "Hyper",
2218
"os": "Linux",

frameworks/Rust/axum/src/main.rs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,13 @@ async fn main() {
2222

2323
let addr = SocketAddr::from((Ipv4Addr::UNSPECIFIED, 8000));
2424

25-
let app = router().await;
25+
let app = Router::new()
26+
.route("/plaintext", get(plaintext))
27+
.route("/json", get(json))
28+
.layer(SetResponseHeaderLayer::<_, Body>::if_not_present(header::SERVER, HeaderValue::from_static("Axum")));
2629

2730
axum::Server::bind(&addr)
2831
.serve(app.into_make_service())
2932
.await
3033
.unwrap();
31-
}
32-
33-
async fn router() -> Router {
34-
Router::new()
35-
.route("/plaintext", get(plaintext))
36-
.route("/json", get(json))
37-
.layer(SetResponseHeaderLayer::<_, Body>::if_not_present(header::SERVER, HeaderValue::from_static("Axum")))
38-
}
34+
}

0 commit comments

Comments
 (0)