diff --git a/Cargo.lock b/Cargo.lock index fca99a9..e739d22 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -740,7 +740,7 @@ checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" [[package]] name = "kosyncrs" -version = "2.0.0" +version = "1.1.1" dependencies = [ "axum", "serde", diff --git a/src/main.rs b/src/main.rs index bbf116f..99373e6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -39,15 +39,12 @@ 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") .ok() .and_then(|v| v.parse().ok()) .unwrap(); - let listen_port: String = env::var("PORT").ok().and_then(|v| v.parse().ok()).unwrap(); let db_pool = PgPoolOptions::new() .max_connections(64) @@ -64,12 +61,10 @@ 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); - let mut bind_with = "127.0.0.1:".to_owned(); - bind_with += &listen_port; - let listener = tokio::net::TcpListener::bind(bind_with) + // run it with hyper on localhost:3003 + let listener = tokio::net::TcpListener::bind("127.0.0.1:3003") .await .unwrap(); axum::serve(listener, app).await.unwrap(); @@ -79,10 +74,6 @@ async fn root() -> &'static str { "KOreader sync server" } -async fn version() -> &'static str { - VERSION -} - async fn create_user( State(db_pool): State, Json(payload): Json, diff --git a/systemd/kosyncrs.service b/systemd/kosyncrs.service index 1809f9a..b405332 100644 --- a/systemd/kosyncrs.service +++ b/systemd/kosyncrs.service @@ -12,7 +12,6 @@ Group=users WorkingDirectory=/home/myuser ExecStart=/usr/local/bin/kosyncrs Environment="PG_URL=postgresql://kosync:password@localhost/kosync" -Environment="PORT=3003" Restart=always [Install]