add version info

This commit is contained in:
Martin Brodbeck 2025-01-08 14:56:18 +01:00
parent d2ccc665fb
commit 3374110f38

View file

@ -39,6 +39,8 @@ pub struct GetProgress {
timestamp: i64,
}
const VERSION: &str = env!("CARGO_PKG_VERSION");
#[tokio::main]
async fn main() {
let pg_url: String = env::var("PG_URL")
@ -61,6 +63,7 @@ async fn main() {
.route("/syncs/progress", put(update_progress))
.route("/syncs/progress/{document}", get(get_progress))
.route("/healthcheck", get(healthcheck))
.route("/version", get(version))
.with_state(db_pool);
// run it with hyper on localhost:3003
@ -74,6 +77,10 @@ async fn root() -> &'static str {
"KOreader sync server"
}
async fn version() -> &'static str {
VERSION
}
async fn create_user(
State(db_pool): State<PgPool>,
Json(payload): Json<User>,