mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-28 00:00:20 +02:00
Replace hyper::Server with axum::Server in docs (#118)
* Replace `hyper::Server` with `axum::Server` in docs * Change readme as well
This commit is contained in:
+11
-11
@@ -105,7 +105,7 @@ pub trait RoutingDsl: crate::sealed::Sealed + Sized {
|
||||
/// let app = route("/", get(first_handler).post(second_handler))
|
||||
/// .route("/foo", get(third_handler));
|
||||
/// # async {
|
||||
/// # hyper::Server::bind(&"".parse().unwrap()).serve(app.into_make_service()).await.unwrap();
|
||||
/// # axum::Server::bind(&"".parse().unwrap()).serve(app.into_make_service()).await.unwrap();
|
||||
/// # };
|
||||
/// ```
|
||||
fn route<T, B>(self, description: &str, svc: T) -> Route<T, Self>
|
||||
@@ -209,7 +209,7 @@ pub trait RoutingDsl: crate::sealed::Sealed + Sized {
|
||||
/// // wont be sent through `ConcurrencyLimit`
|
||||
/// .route("/bar", get(third_handler));
|
||||
/// # async {
|
||||
/// # hyper::Server::bind(&"".parse().unwrap()).serve(app.into_make_service()).await.unwrap();
|
||||
/// # axum::Server::bind(&"".parse().unwrap()).serve(app.into_make_service()).await.unwrap();
|
||||
/// # };
|
||||
/// ```
|
||||
///
|
||||
@@ -231,7 +231,7 @@ pub trait RoutingDsl: crate::sealed::Sealed + Sized {
|
||||
/// .route("/bar", get(third_handler))
|
||||
/// .layer(TraceLayer::new_for_http());
|
||||
/// # async {
|
||||
/// # hyper::Server::bind(&"".parse().unwrap()).serve(app.into_make_service()).await.unwrap();
|
||||
/// # axum::Server::bind(&"".parse().unwrap()).serve(app.into_make_service()).await.unwrap();
|
||||
/// # };
|
||||
/// ```
|
||||
fn layer<L>(self, layer: L) -> Layered<L::Service>
|
||||
@@ -253,7 +253,7 @@ pub trait RoutingDsl: crate::sealed::Sealed + Sized {
|
||||
/// let app = route("/", get(|| async { "Hi!" }));
|
||||
///
|
||||
/// # async {
|
||||
/// hyper::Server::bind(&"0.0.0.0:3000".parse().unwrap())
|
||||
/// axum::Server::bind(&"0.0.0.0:3000".parse().unwrap())
|
||||
/// .serve(app.into_make_service())
|
||||
/// .await
|
||||
/// .expect("server failed");
|
||||
@@ -287,7 +287,7 @@ pub trait RoutingDsl: crate::sealed::Sealed + Sized {
|
||||
/// }
|
||||
///
|
||||
/// # async {
|
||||
/// hyper::Server::bind(&"0.0.0.0:3000".parse().unwrap())
|
||||
/// axum::Server::bind(&"0.0.0.0:3000".parse().unwrap())
|
||||
/// .serve(
|
||||
/// app.into_make_service_with_connect_info::<SocketAddr, _>()
|
||||
/// )
|
||||
@@ -329,7 +329,7 @@ pub trait RoutingDsl: crate::sealed::Sealed + Sized {
|
||||
/// }
|
||||
///
|
||||
/// # async {
|
||||
/// hyper::Server::bind(&"0.0.0.0:3000".parse().unwrap())
|
||||
/// axum::Server::bind(&"0.0.0.0:3000".parse().unwrap())
|
||||
/// .serve(
|
||||
/// app.into_make_service_with_connect_info::<MyConnectInfo, _>()
|
||||
/// )
|
||||
@@ -769,7 +769,7 @@ impl<S> Layered<S> {
|
||||
/// }
|
||||
/// });
|
||||
/// # async {
|
||||
/// # hyper::Server::bind(&"".parse().unwrap())
|
||||
/// # axum::Server::bind(&"".parse().unwrap())
|
||||
/// # .serve(with_errors_handled.into_make_service())
|
||||
/// # .await
|
||||
/// # .unwrap();
|
||||
@@ -803,7 +803,7 @@ impl<S> Layered<S> {
|
||||
/// }
|
||||
/// });
|
||||
/// # async {
|
||||
/// # hyper::Server::bind(&"".parse().unwrap())
|
||||
/// # axum::Server::bind(&"".parse().unwrap())
|
||||
/// # .serve(with_errors_handled.into_make_service())
|
||||
/// # .await
|
||||
/// # .unwrap();
|
||||
@@ -867,7 +867,7 @@ where
|
||||
///
|
||||
/// let app = nest("/api", users_api).route("/careers", get(careers));
|
||||
/// # async {
|
||||
/// # hyper::Server::bind(&"".parse().unwrap()).serve(app.into_make_service()).await.unwrap();
|
||||
/// # axum::Server::bind(&"".parse().unwrap()).serve(app.into_make_service()).await.unwrap();
|
||||
/// # };
|
||||
/// ```
|
||||
///
|
||||
@@ -888,7 +888,7 @@ where
|
||||
///
|
||||
/// let app = nest("/:version/api", users_api);
|
||||
/// # async {
|
||||
/// # hyper::Server::bind(&"".parse().unwrap()).serve(app.into_make_service()).await.unwrap();
|
||||
/// # axum::Server::bind(&"".parse().unwrap()).serve(app.into_make_service()).await.unwrap();
|
||||
/// # };
|
||||
/// ```
|
||||
///
|
||||
@@ -906,7 +906,7 @@ where
|
||||
///
|
||||
/// let app = nest("/public", get(serve_dir_service));
|
||||
/// # async {
|
||||
/// # hyper::Server::bind(&"".parse().unwrap()).serve(app.into_make_service()).await.unwrap();
|
||||
/// # axum::Server::bind(&"".parse().unwrap()).serve(app.into_make_service()).await.unwrap();
|
||||
/// # };
|
||||
/// ```
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user