Skip to content

Commit bce96b5

Browse files
authored
Add version url to quorum api (#2817)
1 parent 52401c7 commit bce96b5

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

apps/quorum/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/quorum/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "quorum"
3-
version = "0.2.1"
3+
version = "0.2.2"
44
edition = "2021"
55

66
[dependencies]

apps/quorum/src/api.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use axum::{
44
Json, Router,
55
};
66
use axum_prometheus::{EndpointLabel, PrometheusMetricLayerBuilder};
7+
use clap::crate_version;
78
use secp256k1::{
89
ecdsa::{RecoverableSignature, RecoveryId},
910
Message, Secp256k1,
@@ -27,6 +28,10 @@ use crate::{
2728

2829
pub type Payload<'a> = &'a RawMessage;
2930

31+
async fn root() -> String {
32+
format!("Quorum API {}", crate_version!())
33+
}
34+
3035
pub async fn run(listen_address: SocketAddr, state: State) -> anyhow::Result<()> {
3136
tracing::info!("Starting server...");
3237

@@ -38,6 +43,7 @@ pub async fn run(listen_address: SocketAddr, state: State) -> anyhow::Result<()>
3843
.build_pair();
3944

4045
let routes = Router::new()
46+
.route("/", get(root))
4147
.route("/live", get(|| async { "OK" }))
4248
.route("/observation", post(post_observation))
4349
.route("/ws", get(ws_route_handler))

0 commit comments

Comments
 (0)