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 @@
|
||||
// <default-headers>
|
||||
use actix_web::{http, middleware, web, App, HttpResponse};
|
||||
|
||||
fn main() {
|
||||
pub fn main() {
|
||||
App::new()
|
||||
.wrap(middleware::DefaultHeaders::new().header("X-Version", "0.2"))
|
||||
.service(
|
||||
|
@ -10,7 +10,7 @@ fn render_500<B>(mut res: dev::ServiceResponse<B>) -> Result<ErrorHandlerRespons
|
||||
Ok(ErrorHandlerResponse::Response(res))
|
||||
}
|
||||
|
||||
fn main() {
|
||||
pub fn main() {
|
||||
App::new()
|
||||
.wrap(
|
||||
ErrorHandlers::new()
|
||||
|
@ -3,7 +3,7 @@ use actix_web::middleware::Logger;
|
||||
use actix_web::App;
|
||||
use env_logger;
|
||||
|
||||
fn main() {
|
||||
pub fn main() {
|
||||
std::env::set_var("RUST_LOG", "actix_web=info");
|
||||
env_logger::init();
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
mod default_headers;
|
||||
mod errorhandler;
|
||||
mod logger;
|
||||
mod user_sessions;
|
||||
pub mod default_headers;
|
||||
pub mod errorhandler;
|
||||
pub mod logger;
|
||||
pub mod user_sessions;
|
||||
// <main>
|
||||
use actix_service::{Service, Transform};
|
||||
use actix_web::{dev::ServiceRequest, dev::ServiceResponse, web, App, Error};
|
||||
|
@ -19,7 +19,7 @@ fn index(session: Session, req: HttpRequest) -> Result<&'static str> {
|
||||
Ok("welcome!")
|
||||
}
|
||||
|
||||
fn main() -> std::io::Result<()> {
|
||||
pub fn main() -> std::io::Result<()> {
|
||||
std::env::set_var("RUST_LOG", "actix_web=info");
|
||||
env_logger::init();
|
||||
|
||||
|
Reference in New Issue
Block a user