removeswagger ui, itis nice but I don't need it

This commit is contained in:
Sebastian Hugentobler 2024-07-11 07:39:03 +02:00
parent 402b8e3a57
commit 9ebfa27b11
Signed by: shu
GPG Key ID: BB32CF3CA052C2F0
6 changed files with 14 additions and 16 deletions

16
Cargo.lock generated
View File

@ -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",

View File

@ -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]

View File

@ -35,4 +35,4 @@ Options:
-V, --version Print version
```
The url for koreader is `http://<ADDRESS>/api`.
The url for koreader is `http://<ADDRESS>`.

View File

@ -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"

View File

@ -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,

View File

@ -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);