diff --git a/examples/hello_world.rs b/examples/hello_world.rs index 9aefe148..3d6f9d0f 100644 --- a/examples/hello_world.rs +++ b/examples/hello_world.rs @@ -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() { diff --git a/src/lib.rs b/src/lib.rs index b7e8043f..06492fae 100644 --- a/src/lib.rs +++ b/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,