return version info in /api/info
parent
990f1e07e0
commit
9c71eea8e1
|
@ -19,6 +19,8 @@ use std::convert::TryFrom;
|
|||
use std::path::PathBuf;
|
||||
use std::sync::{Arc, RwLock};
|
||||
|
||||
const VERSION: &str = env!("CARGO_PKG_VERSION");
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct State {
|
||||
pub vault_name: Option<String>,
|
||||
|
@ -214,6 +216,7 @@ pub async fn get_jobs(state: web::Data<State>) -> Result<HttpResponse, Error> {
|
|||
pub async fn get_info(state: web::Data<State>) -> Result<HttpResponse, Error> {
|
||||
Ok(HttpResponse::Ok().json(json!({
|
||||
"name": state.vault_name,
|
||||
"location": state.directory
|
||||
"location": state.directory,
|
||||
"version": VERSION
|
||||
})))
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue