Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mintd: Add support for HTTP compression #472

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/cdk-mintd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
futures = { version = "0.3.28", default-features = false }
serde = { version = "1", default-features = false, features = ["derive"] }
bip39 = "2.0"
tower-http = { version = "0.4.4", features = ["cors"] }
tower-http = { version = "0.4.4", features = ["cors", "compression-full"] }
lightning-invoice = { version = "0.32.0", features = ["serde", "std"] }
home = "0.5.5"
url = "2.3"
Expand Down
2 changes: 2 additions & 0 deletions crates/cdk-mintd/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ use cdk_redb::MintRedbDatabase;
use cdk_sqlite::MintSqliteDatabase;
use clap::Parser;
use tokio::sync::Notify;
use tower_http::compression::CompressionLayer;
use tower_http::cors::CorsLayer;
use tracing_subscriber::EnvFilter;
#[cfg(feature = "swagger")]
Expand Down Expand Up @@ -296,6 +297,7 @@ async fn main() -> anyhow::Result<()> {

let mut mint_service = Router::new()
.merge(v1_service)
.layer(CompressionLayer::new())
.layer(CorsLayer::permissive());

#[cfg(feature = "swagger")]
Expand Down
Loading