diff --git a/Cargo.toml b/Cargo.toml index 5e4aaae..8dd5389 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,7 +21,7 @@ tower-http = { version = "0.6", features = ["trace", "fs"], optional = true } rand = { version = "0.8", features = ["getrandom"] } getrandom = { version = "0.2", features = ["js"] } http = "1" -axum = { version = "0.7", optional = true, features = ["multipart"] } +axum = { version = "0.8", optional = true, features = ["multipart"] } serde_json = "1.0" ammonia = { version = "4", optional = true } syntect = { version = "5", default-features = false, features = ["default-syntaxes", "default-themes", "default-fancy", "html", "parsing", "dump-load", "yaml-load"], optional = true } diff --git a/src/main.rs b/src/main.rs index 8bf8c98..6785fe8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -45,6 +45,8 @@ fn main() { .invalidate_after(std::time::Duration::from_secs(300)), ); let router = axum::Router::new() + .route("/api/upload", axum::routing::post(crate::api::upload::upload_image)) + .nest_service("/uploads", tower_http::services::ServeDir::new("uploads")) .serve_dioxus_application(config, router::AppRouter) .layer( TraceLayer::new_for_http()