From 9ebfa27b1120dd3d794c5bfa41a7c1b7da676a25 Mon Sep 17 00:00:00 2001 From: Sebastian Hugentobler Date: Thu, 11 Jul 2024 07:39:03 +0200 Subject: [PATCH] removeswagger ui, itis nice but I don't need it --- Cargo.lock | 16 ++++++++-------- Cargo.toml | 2 +- README.md | 2 +- app/Cargo.toml | 4 ++-- app/src/api.rs | 2 +- app/src/lib.rs | 4 +--- 6 files changed, 14 insertions(+), 16 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7a2f4ad..5f2f2b4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -587,9 +587,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.8" +version = "4.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84b3edb18336f4df585bc9aa31dd99c036dfa5dc5e9a2939a722a188f3a8970d" +checksum = "64acc1846d54c1fe936a78dc189c34e28d3f5afc348403f28ecf53660b9b8462" dependencies = [ "clap_builder", "clap_derive", @@ -597,9 +597,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.8" +version = "4.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1c09dd5ada6c6c78075d6fd0da3f90d8080651e2d6cc8eb2f1aaa4034ced708" +checksum = "6fb8393d67ba2e7bfaf28a23458e4e2b543cc73a99595511eb207fdb8aede942" dependencies = [ "anstream", "anstyle", @@ -2599,18 +2599,18 @@ checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "serde" -version = "1.0.203" +version = "1.0.204" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" +checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.203" +version = "1.0.204" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" +checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index 929ef11..cbdd02d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ members = [ [workspace.dependencies] sea-orm = "0.12.15" -serde = "1.0.203" +serde = "1.0.204" time = "0.3.36" [workspace.package] diff --git a/README.md b/README.md index ebf31f0..1e8b305 100644 --- a/README.md +++ b/README.md @@ -35,4 +35,4 @@ Options: -V, --version Print version ``` -The url for koreader is `http://
/api`. +The url for koreader is `http://
`. diff --git a/app/Cargo.toml b/app/Cargo.toml index 5feec0b..8485439 100644 --- a/app/Cargo.toml +++ b/app/Cargo.toml @@ -10,9 +10,9 @@ repository = { workspace = true } entity = { path = "../entity" } migration = { path = "../migration" } anyhow = "1.0.86" -clap = { version = "4.5.8", features = ["env", "derive"] } +clap = { version = "4.5.9", features = ["env", "derive"] } poem = "3.0.1" -poem-openapi = { version = "5.0.2", features = ["swagger-ui"] } +poem-openapi = "5.0.2" sea-orm = { workspace = true, features = ["with-time", "sqlx-sqlite", "sqlx-postgres", "sqlx-mysql", "runtime-tokio-rustls", "macros" ] } serde = { workspace = true, features = ["derive"] } thiserror = "1.0.61" diff --git a/app/src/api.rs b/app/src/api.rs index 290308c..541458d 100644 --- a/app/src/api.rs +++ b/app/src/api.rs @@ -34,7 +34,7 @@ struct UserCreated { username: String, } -/// Datafor pushing progress. +/// Data for pushing progress. #[derive(Debug, Clone, Object, Deserialize)] pub struct DocumentUpdate { pub device: String, diff --git a/app/src/lib.rs b/app/src/lib.rs index a946bc2..97bd12b 100644 --- a/app/src/lib.rs +++ b/app/src/lib.rs @@ -30,7 +30,7 @@ pub async fn run(args: &Config, db_url: &str) -> Result<()> { db, }); - const API_PATH: &str = "/api"; + const API_PATH: &str = "/"; let api_uri = Uri::builder() .scheme(Scheme::HTTP) .authority(args.address.clone()) @@ -38,10 +38,8 @@ pub async fn run(args: &Config, db_url: &str) -> Result<()> { .build()?; let api_service = OpenApiService::new(Api, "Hesinde Sync", "1.0").server(api_uri.to_string()); - let ui = api_service.swagger_ui(); let app = Route::new() .nest(API_PATH, api_service) - .nest("/", ui) .data(app_state) .with(Tracing);