mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-28 00:00:20 +02:00
Add serve function and remove Server re-export (#1868)
This commit is contained in:
@@ -41,9 +41,7 @@ use std::fmt;
|
||||
/// }
|
||||
///
|
||||
/// let app = Router::new().route("/list_things", get(list_things));
|
||||
/// # async {
|
||||
/// # axum::Server::bind(&"".parse().unwrap()).serve(app.into_make_service()).await.unwrap();
|
||||
/// # };
|
||||
/// # let _: Router = app;
|
||||
/// ```
|
||||
///
|
||||
/// If the query string cannot be parsed it will reject the request with a `400
|
||||
|
||||
@@ -105,7 +105,7 @@ use axum_macros::__private_axum_test as test;
|
||||
pub(crate) mod test_helpers {
|
||||
#![allow(unused_imports)]
|
||||
|
||||
use axum::{body::HttpBody, BoxError, Router};
|
||||
use axum::{extract::Request, response::Response, serve};
|
||||
|
||||
mod test_client {
|
||||
#![allow(dead_code)]
|
||||
|
||||
@@ -45,9 +45,7 @@ use prost::Message;
|
||||
/// }
|
||||
///
|
||||
/// let app = Router::new().route("/users", post(create_user));
|
||||
/// # async {
|
||||
/// # axum::Server::bind(&"".parse().unwrap()).serve(app.into_make_service()).await.unwrap();
|
||||
/// # };
|
||||
/// # let _: Router = app;
|
||||
/// ```
|
||||
///
|
||||
/// # As response
|
||||
@@ -85,9 +83,7 @@ use prost::Message;
|
||||
/// }
|
||||
///
|
||||
/// let app = Router::new().route("/users/:id", get(get_user));
|
||||
/// # async {
|
||||
/// # axum::Server::bind(&"".parse().unwrap()).serve(app.into_make_service()).await.unwrap();
|
||||
/// # };
|
||||
/// # let _: Router = app;
|
||||
/// ```
|
||||
#[derive(Debug, Clone, Copy, Default)]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "protobuf")))]
|
||||
|
||||
Reference in New Issue
Block a user