Move middleware::from_fn into axum (#719)

* Move `middleware::from_fn` into axum

* changelog

* fix feature

* Rephrase changelog a bit
This commit is contained in:
David Pedersen
2022-01-25 10:19:06 +01:00
committed by GitHub
parent 208720be53
commit 9004a14302
11 changed files with 42 additions and 35 deletions
+1 -1
View File
@@ -7,11 +7,11 @@
use axum::{
body::{Body, Bytes},
http::{Request, StatusCode},
middleware::{self, Next},
response::{IntoResponse, Response},
routing::post,
Router,
};
use axum_extra::middleware::{self, Next};
use std::net::SocketAddr;
#[tokio::main]
+8 -2
View File
@@ -7,8 +7,14 @@
//! cargo run -p example-prometheus-metrics
//! ```
use axum::{extract::MatchedPath, http::Request, response::IntoResponse, routing::get, Router};
use axum_extra::middleware::{self, Next};
use axum::{
extract::MatchedPath,
http::Request,
middleware::{self, Next},
response::IntoResponse,
routing::get,
Router,
};
use metrics_exporter_prometheus::{Matcher, PrometheusBuilder, PrometheusHandle};
use std::{
future::ready,