Compare commits

..

1 Commits

Author SHA1 Message Date
adb312acbf Add renovate.json 2024-08-03 00:07:20 +00:00
4 changed files with 7 additions and 8 deletions

1
Cargo.lock generated
View File

@ -666,7 +666,6 @@ dependencies = [
"actix-web", "actix-web",
"clap", "clap",
"env_logger", "env_logger",
"log",
] ]
[[package]] [[package]]

View File

@ -7,4 +7,3 @@ edition = "2021"
clap = {version = "4.5.9", features = ["derive", "env"]} clap = {version = "4.5.9", features = ["derive", "env"]}
actix-web = "4" actix-web = "4"
env_logger = "0.11.5" env_logger = "0.11.5"
log = "0.4.22"

3
renovate.json Normal file
View File

@ -0,0 +1,3 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json"
}

View File

@ -7,9 +7,9 @@ use env_logger::Env;
#[derive(clap::Parser, Debug)] #[derive(clap::Parser, Debug)]
#[command(version, about, long_about = None)] #[command(version, about, long_about = None)]
struct Args { struct Args {
/// Listen address /// Name of the person to greet
#[arg(env, short, long, default_value = "0.0.0.0:8000")] #[arg(env, short, long, default_value = "0.0.0.0:8000")]
listen_addr: String, listen_url: String,
} }
#[get("/")] #[get("/")]
@ -32,8 +32,6 @@ async fn main() -> std::io::Result<()> {
let args = Args::parse(); let args = Args::parse();
log::info!("Starting to listen on {}", args.listen_addr);
HttpServer::new(|| { HttpServer::new(|| {
App::new() App::new()
.wrap(Logger::default()) .wrap(Logger::default())
@ -41,7 +39,7 @@ async fn main() -> std::io::Result<()> {
.service(echo) .service(echo)
.route("/hey", web::get().to(manual_hello)) .route("/hey", web::get().to(manual_hello))
}) })
.bind(args.listen_addr)? .bind(args.listen_url)?
.run() .run()
.await .await
} }