mirror of
https://github.com/actix/actix-website
synced 2025-06-27 07:29:02 +02:00
migrate to docusaurus (v2) (#266)
Co-authored-by: ibraheemdev <ibrah1440@gmail.com>
This commit is contained in:
1
examples/server/rustfmt.toml
Normal file
1
examples/server/rustfmt.toml
Normal file
@ -0,0 +1 @@
|
||||
max_width = 80
|
14
examples/server/src/keep_alive_tp.rs
Normal file
14
examples/server/src/keep_alive_tp.rs
Normal file
@ -0,0 +1,14 @@
|
||||
// <example>
|
||||
use actix_web::{http, HttpRequest, HttpResponse};
|
||||
|
||||
async fn index(req: HttpRequest) -> HttpResponse {
|
||||
HttpResponse::Ok()
|
||||
.connection_type(http::ConnectionType::Close) // <- Close connection
|
||||
.force_close() // <- Alternative method
|
||||
.finish()
|
||||
}
|
||||
// </example>
|
||||
|
||||
// ConnectionType::Close
|
||||
// ConnectionType::KeepAlive
|
||||
// ConnectionType::Upgrade
|
Reference in New Issue
Block a user