Skip to content

Commit 64406fd

Browse files
committed
Info endpoint
1 parent 44aad20 commit 64406fd

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Diff for: clickhouse-proxy/src/lib.rs

+13
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,11 @@ impl State {
246246
}
247247
}
248248

249+
#[derive(serde::Serialize)]
250+
struct Info {
251+
version: &'static str,
252+
}
253+
249254
pub async fn main_impl(args: Flags) -> anyhow::Result<()> {
250255
sqlsonnet::setup_logging();
251256

@@ -266,6 +271,14 @@ pub async fn main_impl(args: Flags) -> anyhow::Result<()> {
266271
let app = tracing_layer::add_layer(
267272
axum::Router::new()
268273
.route("/", axum::routing::post(handle_query))
274+
.route(
275+
"/info",
276+
axum::routing::get(|| async move {
277+
axum::Json(Info {
278+
version: env!("CARGO_PKG_VERSION"),
279+
})
280+
}),
281+
)
269282
.nest("/play", playground::router())
270283
.route(
271284
"/metrics",

0 commit comments

Comments
 (0)