Skip to content

Commit

Permalink
add startup logging to basic example
Browse files Browse the repository at this point in the history
  • Loading branch information
robjtede committed Aug 1, 2023
1 parent 75a97f6 commit 605cd7c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions actix-web/examples/basic.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![allow(clippy::uninlined_format_args)]

use actix_web::{get, middleware, web, App, HttpRequest, HttpResponse, HttpServer};

#[get("/resource1/{name}/index.html")]
Expand All @@ -22,6 +20,8 @@ async fn no_params() -> &'static str {
async fn main() -> std::io::Result<()> {
env_logger::init_from_env(env_logger::Env::new().default_filter_or("info"));

log::info!("starting HTTP server at http://localhost:8080");

HttpServer::new(|| {
App::new()
.wrap(middleware::DefaultHeaders::new().add(("X-Version", "0.2")))
Expand Down

0 comments on commit 605cd7c

Please sign in to comment.