mirror of
https://github.com/actix/actix-extras.git
synced 2025-06-26 10:27:42 +02:00
stop cloning request across service call (#213)
This commit is contained in:
@ -35,9 +35,13 @@ async fn main() -> std::io::Result<()> {
|
||||
.allowed_header(header::CONTENT_TYPE)
|
||||
// set list of headers that are safe to expose
|
||||
.expose_headers(&[header::CONTENT_DISPOSITION])
|
||||
// set CORS rules ttl
|
||||
// set preflight cache TTL
|
||||
.max_age(3600),
|
||||
)
|
||||
.route(
|
||||
"/{n}/init",
|
||||
web::to(|path: web::Path<String>| async move { path.into_inner() }),
|
||||
)
|
||||
.default_service(web::to(|| async { "Hello world!" }))
|
||||
})
|
||||
.bind("127.0.0.1:8080")?
|
||||
|
Reference in New Issue
Block a user