add version info
This commit is contained in:
parent
d2ccc665fb
commit
3374110f38
1 changed files with 7 additions and 0 deletions
|
@ -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>,
|
||||
|
|
Loading…
Reference in a new issue