mirror of
https://github.com/actix/actix-website
synced 2025-06-27 07:29:02 +02:00
moves individual examples to pub mods to force building and have less dead_code
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
// <keep-alive>
|
||||
use actix_web::{web, App, HttpResponse, HttpServer};
|
||||
|
||||
fn main() {
|
||||
pub fn main() {
|
||||
HttpServer::new(|| {
|
||||
App::new().route("/", web::get().to(|| HttpResponse::Ok()))
|
||||
})
|
||||
|
@ -1,7 +1,7 @@
|
||||
// <example>
|
||||
use actix_web::{http, HttpRequest, HttpResponse};
|
||||
|
||||
fn index(req: HttpRequest) -> HttpResponse {
|
||||
pub fn index(req: HttpRequest) -> HttpResponse {
|
||||
HttpResponse::Ok()
|
||||
.connection_type(http::ConnectionType::Close) // <- Close connection
|
||||
.force_close() // <- Alternative method
|
||||
|
@ -1,8 +1,8 @@
|
||||
// mod keep_alive;
|
||||
// mod keep_alive_tp;
|
||||
mod signals;
|
||||
mod ssl;
|
||||
mod workers;
|
||||
// pub mod keep_alive;
|
||||
// pub mod keep_alive_tp;
|
||||
pub mod signals;
|
||||
pub mod ssl;
|
||||
pub mod workers;
|
||||
|
||||
// <main>
|
||||
use actix_web::{web, App, HttpResponse, HttpServer};
|
||||
|
Reference in New Issue
Block a user