mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-25 00:00:23 +02:00
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:
@@ -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]
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user