1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-08-31 00:50:20 +02:00

rename .middleware to .wrap

This commit is contained in:
Nikolay Kim
2019-03-25 13:02:10 -07:00
parent 939d2e745c
commit 86a21c956c
12 changed files with 68 additions and 33 deletions

View File

@@ -1,8 +1,8 @@
//! Cross-origin resource sharing (CORS) for Actix applications
//!
//! CORS middleware could be used with application and with resource.
//! Cors middleware could be used as parameter for `App::middleware()`,
//! `Resource::middleware()` or `Scope::middleware()` methods.
//! Cors middleware could be used as parameter for `App::wrap()`,
//! `Resource::wrap()` or `Scope::wrap()` methods.
//!
//! # Example
//!
@@ -16,7 +16,7 @@
//!
//! fn main() -> std::io::Result<()> {
//! HttpServer::new(|| App::new()
//! .middleware(
//! .wrap(
//! Cors::new() // <- Construct CORS middleware builder
//! .allowed_origin("https://www.rust-lang.org/")
//! .allowed_methods(vec!["GET", "POST"])