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

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