1
0
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:
Cameron Dershem
2019-06-19 00:20:50 -04:00
parent a3cb721ed3
commit 4f9bd8b724
49 changed files with 226 additions and 191 deletions

View File

@ -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()))
})

View File

@ -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

View File

@ -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};