mirror of
https://github.com/actix/examples
synced 2025-06-26 17:17:42 +02:00
standardize examples
This commit is contained in:
@ -6,9 +6,10 @@ edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
actix-web.workspace = true
|
||||
env_logger.workspace = true
|
||||
yarte = { version = "0.15", features = ["bytes-buf", "html-min"] }
|
||||
derive_more.workspace = true
|
||||
env_logger.workspace = true
|
||||
log.workspace = true
|
||||
yarte = { version = "0.15", features = ["bytes-buf", "html-min"] }
|
||||
|
||||
[build-dependencies.yarte_helpers]
|
||||
version = "0.15.6"
|
||||
|
@ -23,10 +23,10 @@ async fn index(query: web::Query<HashMap<String, String>>) -> Result<HttpRespons
|
||||
|
||||
#[actix_web::main]
|
||||
async fn main() -> std::io::Result<()> {
|
||||
std::env::set_var("RUST_LOG", "actix_web=info");
|
||||
env_logger::init();
|
||||
env_logger::init_from_env(env_logger::Env::new().default_filter_or("info"));
|
||||
|
||||
log::info!("starting HTTP server at http://localhost:8080");
|
||||
|
||||
// start http server
|
||||
HttpServer::new(move || App::new().wrap(Logger::default()).service(index))
|
||||
.bind(("127.0.0.1", 8080))?
|
||||
.run()
|
||||
|
Reference in New Issue
Block a user