restore version route

This commit is contained in:
mpostma 2021-03-15 19:08:19 +01:00
parent 0c17b166df
commit 6a742ee62c
No known key found for this signature in database
GPG key ID: CBC8A7C1D7A28C3A
6 changed files with 24 additions and 3 deletions

View file

@ -56,5 +56,9 @@ struct VersionResponse {
#[get("/version", wrap = "Authentication::Private")]
async fn get_version() -> HttpResponse {
todo!()
HttpResponse::Ok().json(VersionResponse {
commit_sha: env!("VERGEN_SHA").to_string(),
build_date: env!("VERGEN_BUILD_TIMESTAMP").to_string(),
pkg_version: env!("CARGO_PKG_VERSION").to_string(),
})
}