Skip to content

Commit

Permalink
serve version number at /instance_version (#28261)
Browse files Browse the repository at this point in the history
Serve instance version at /instance_version

GitOrigin-RevId: 5fe117a855298e17762c644bafcd8857d63a1eb0
  • Loading branch information
gautamg795 authored and Convex, Inc. committed Jul 24, 2024
1 parent 8fe76f6 commit 1e53c48
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions crates/local_backend/src/router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ use http::{
StatusCode,
};
use isolate::HTTP_ACTION_BODY_LIMIT;
use metrics::SERVER_VERSION_STR;
use tower::ServiceBuilder;
use tower_http::{
cors::{
Expand Down Expand Up @@ -197,11 +198,13 @@ pub async fn router(st: LocalAppState) -> Router {
});

let instance_name = st.instance_name.clone();
let version = SERVER_VERSION_STR.to_string();

Router::new()
.nest("/api", api_routes)
// /instance_name is used by the CLI and dashboard to check connectivity!
.route("/instance_name", get(|| async move { instance_name }))
.route("/instance_version", get(|| async move { version }))
.layer(cors().await)
.with_state(st)
.merge(migrated)
Expand Down

0 comments on commit 1e53c48

Please sign in to comment.