update axum

This commit is contained in:
Ninja3047 2022-07-10 23:31:54 -04:00 committed by Edward Shen
parent c934b36b35
commit 4694683b9a
2 changed files with 19 additions and 19 deletions

View file

@ -7,24 +7,24 @@ edition = "2021"
[dependencies] [dependencies]
omegaupload-common = { path = "../common" } omegaupload-common = { path = "../common" }
anyhow = "1" anyhow = "1.0.58"
axum = { version = "0.4", features = ["http2", "headers"] } axum = { version = "0.5.11", features = ["http2", "headers"] }
bincode = "1" bincode = "1.3.3"
# We don't care about which version (We want to match with axum), we just need # We don't care about which version (We want to match with axum), we just need
# to enable the feature # to enable the feature
bytes = { version = "*", features = ["serde"] } bytes = { version = "1.1.0", features = ["serde"] }
chrono = { version = "0.4", features = ["serde"] } chrono = { version = "0.4.19", features = ["serde"] }
futures = "0.3" futures = "0.3.21"
# We just need to pull in whatever axum is pulling in # We just need to pull in whatever axum is pulling in
headers = "*" headers = "0.3.7"
lazy_static = "1" lazy_static = "1.4.0"
# Disable `random()` and `thread_rng()` # Disable `random()` and `thread_rng()`
rand = { version = "0.8", default_features = false } rand = { version = "0.8.5", default_features = false }
rocksdb = { version = "0.18", default_features = false, features = ["zstd"] } rocksdb = { version = "0.18.0", default_features = false, features = ["zstd"] }
serde = { version = "1", features = ["derive"] } serde = { version = "1.0.138", features = ["derive"] }
signal-hook = "0.3" signal-hook = "0.3.14"
signal-hook-tokio = { version = "0.3", features = ["futures-v0_3"] } signal-hook-tokio = { version = "0.3.1", features = ["futures-v0_3"] }
tokio = { version = "1", features = ["macros", "rt-multi-thread"] } tokio = { version = "1.19.2", features = ["macros", "rt-multi-thread"] }
tower-http = { version = "0.2", features = ["fs"] } tower-http = { version = "0.3.4", features = ["fs"] }
tracing = { version = "0.1" } tracing = "0.1.35"
tracing-subscriber = "0.3" tracing-subscriber = "0.3.14"

View file

@ -27,7 +27,7 @@ use axum::extract::{Extension, Path, TypedHeader};
use axum::http::header::EXPIRES; use axum::http::header::EXPIRES;
use axum::http::StatusCode; use axum::http::StatusCode;
use axum::routing::{get, get_service, post}; use axum::routing::{get, get_service, post};
use axum::{AddExtensionLayer, Router}; use axum::Router;
use chrono::Utc; use chrono::Utc;
use futures::stream::StreamExt; use futures::stream::StreamExt;
use headers::HeaderMap; use headers::HeaderMap;
@ -103,7 +103,7 @@ async fn main() -> Result<()> {
&format!("{API_ENDPOINT}/:code"), &format!("{API_ENDPOINT}/:code"),
get(paste::<SHORT_CODE_SIZE>).delete(delete::<SHORT_CODE_SIZE>), get(paste::<SHORT_CODE_SIZE>).delete(delete::<SHORT_CODE_SIZE>),
) )
.layer(AddExtensionLayer::new(db)) .layer(axum::Extension(db))
.into_make_service() .into_make_service()
}) })
.await?; .await?;