diff --git a/docs/middleware.md b/docs/middleware.md index a8551a4..ee2a860 100644 --- a/docs/middleware.md +++ b/docs/middleware.md @@ -27,7 +27,7 @@ Alternatively, for simple use cases, you can use [_wrap_fn_][wrap_fn] to create -You can also use [_from_fn_][from_fn] to in combination with [_wrap_][wrap] to create a function as middlware. +You can also use [_from_fn_][from_fn] to in combination with [_wrap_][wrap] to create a function as middleware. diff --git a/examples/middleware/src/from_fn.rs b/examples/middleware/src/from_fn.rs index 2c5ccc0..461b8e1 100644 --- a/examples/middleware/src/from_fn.rs +++ b/examples/middleware/src/from_fn.rs @@ -8,7 +8,7 @@ use actix_web::{ App, Error, }; -async fn my_midleware( +async fn my_middleware( req: ServiceRequest, next: Next, ) -> Result, Error> { @@ -19,6 +19,6 @@ async fn my_midleware( #[actix_web::main] async fn main() { - let app = App::new().wrap(from_fn(my_midleware)); + let app = App::new().wrap(from_fn(my_middleware)); } //