路由
从 0.3 开始,axum 的路由的导入路径发生了改变。IntoResponse
从 0.4 开始,实现`IntoResponse`不需要`Body`和`BodyError`。静态资源
0.3 的静态资源有 BUG,0.4 终于恢复。deadpool-postgres
deadpool-postgres 0.10开始,需要手动开启`serde` feature中文乱码及utf-8
axum 0.4开始已经默认带上`charset=utf-8`响应头,中文不再乱码。状态共享
从 0.4.7 开始,`axum::AddExtensionLayer` 已标记为“过时(Deprecated)”config 重大改变
从 0.12 开始,config 的API发生重大改变
中文乱码及utf-8
axum 0.4开始已经默认带上charset=utf-8
响应头,中文不再乱码。
async fn cn() -> (HeaderMap, &'static str) {
let mut headers = HeaderMap::new();
headers.insert(
HeaderName::from_static("content-type"),
HeaderValue::from_static("text/plain;charset=utf-8"),
);
(headers, "你好,axum.rs")
}