mirror of
https://github.com/tokio-rs/axum.git
synced 2025-01-15 22:20:53 +01:00
Add prelude
This commit is contained in:
parent
46398afc72
commit
470d6ceabd
2 changed files with 11 additions and 1 deletions
|
@ -2,7 +2,7 @@ use http::{Request, StatusCode};
|
|||
use hyper::Server;
|
||||
use std::net::SocketAddr;
|
||||
use tower::make::Shared;
|
||||
use tower_web::{body::Body, extract, get, response, route, AddRoute};
|
||||
use tower_web::prelude::*;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
|
|
10
src/lib.rs
10
src/lib.rs
|
@ -68,6 +68,16 @@ pub use self::{
|
|||
pub use async_trait::async_trait;
|
||||
pub use tower_http::add_extension::{AddExtension, AddExtensionLayer};
|
||||
|
||||
pub mod prelude {
|
||||
pub use crate::{
|
||||
body::Body,
|
||||
extract,
|
||||
handler::{get, on, post, Handler},
|
||||
response, route,
|
||||
routing::AddRoute,
|
||||
};
|
||||
}
|
||||
|
||||
pub fn route<S>(spec: &str, svc: S) -> Route<S, EmptyRouter>
|
||||
where
|
||||
S: Service<Request<Body>, Error = Infallible> + Clone,
|
||||
|
|
Loading…
Reference in a new issue