mirror of
https://github.com/neodyland/sbv2-api.git
synced 2026-01-16 03:12:56 +00:00
fix bug
This commit is contained in:
1
Cargo.lock
generated
1
Cargo.lock
generated
@@ -2477,6 +2477,7 @@ version = "0.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b3ab4b7269d14d93626b0bfedf212f1b0995cb7d13d35daba21d579511e7fae8"
|
||||
dependencies = [
|
||||
"axum",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"utoipa",
|
||||
|
||||
@@ -13,7 +13,7 @@ sbv2_core = { version = "0.2.0-alpha", path = "../sbv2_core" }
|
||||
serde = { version = "1.0.210", features = ["derive"] }
|
||||
tokio = { version = "1.40.0", features = ["full"] }
|
||||
utoipa = { version = "4.2.3", features = ["axum_extras"] }
|
||||
utoipa-scalar = "0.1.0"
|
||||
utoipa-scalar = { version = "0.1.0", features = ["axum"] }
|
||||
|
||||
[features]
|
||||
coreml = ["sbv2_core/coreml"]
|
||||
|
||||
@@ -19,7 +19,7 @@ use crate::error::AppResult;
|
||||
|
||||
#[derive(OpenApi)]
|
||||
#[openapi(
|
||||
paths(openapi, models, synthesize),
|
||||
paths(models, synthesize),
|
||||
components(schemas(SynthesizeRequest))
|
||||
)]
|
||||
struct ApiDoc;
|
||||
@@ -164,7 +164,7 @@ async fn main() -> anyhow::Result<()> {
|
||||
.route("/synthesize", post(synthesize))
|
||||
.route("/models", get(models))
|
||||
.with_state(AppState::new().await?)
|
||||
.merge(Scalar::with_url("/docs", ApiDoc::openapi()))
|
||||
.merge(Scalar::with_url("/docs", ApiDoc::openapi()));
|
||||
let addr = env::var("ADDR").unwrap_or("0.0.0.0:3000".to_string());
|
||||
let listener = tokio::net::TcpListener::bind(&addr).await?;
|
||||
log::info!("Listening on {addr}");
|
||||
|
||||
Reference in New Issue
Block a user