[package]
name = "axum-bootstrap"
version = "0.1.18"
edition = "2024"
authors = ["arloor <admin@arloor.com>"]
license = "MIT OR Apache-2.0"
rust-version = "1.85"
repository = "https://github.com/arloor/axum-bootstrap"
description = "a way to bootstrap a web server with axum, including TLS, logging, monitoring, and more."
keywords = ["axum", "http-server"]
readme = "README.md"

[features]
default = ["use_tracing_subscriber"]
mysql = []
use_tracing_subscriber = ["dep:tracing-subscriber", "dep:time"]
use_env_logger = ["dep:env_logger"]
use_flexi_logger = ["dep:flexi_logger"]

[[example]]
name = "basic"
path = "examples/basic.rs"

[dependencies]
# tls需要
tokio-rustls = { version = "0.26", features = [
    "logging",
    "tls12",
], default-features = false }
socket2 = "0.6"
rustls-pki-types = "1"
rustls-pemfile = "2.2.0"
tokio = { version = "1", features = ["full"] }

# http服务器
axum = "0.8"
hyper = { version = "1", features = ["full"] }
hyper-util = { version = "0.1", features = [
    "tokio",
    "server-auto",
    "server-graceful",
] }

# 日志和监控
log = "0.4"
flexi_logger = { version = "0.31", optional = true }
env_logger = { version = "0.11", optional = true }
chrono = "0.4"
# tracing使用
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = [
    "env-filter",
    "local-time",
], optional = true }
time = { version = "0.3", features = ["macros"], optional = true }
tower-service = "0.3"
tower = "0.5"
anyhow = "1"

# 序列化 - 核心库需要
serde = { version = "1", features = ["derive"] }
serde_json = "1"


# 其他实用库

futures-util = "0.3"
pin-project-lite = "0.2"


[dev-dependencies]
# 以下依赖仅在示例代码中使用
clap = { version = "4.5", features = ["derive"] }
prometheus-client = "0.24"
serde_yaml = "0.9"
tower-http = { version = "0.6", features = [
    "compression-full",
    "cors",
    "timeout",
    "trace",
] }
# 数据库 - 仅examples使用
sqlx = { version = "0.8", features = [
    "mysql",
    "runtime-tokio-rustls",
    "chrono",
] }
sqlx-mysql = "0.8"


axum-macros = "0.5"
reqwest = { version = "0.12", default-features = false, features = [
    "charset",
    "rustls-tls",
    "http2",
    "macos-system-configuration",
    "stream",
] }
