Skip to content

Commit

Permalink
feat(all): access address
Browse files Browse the repository at this point in the history
  • Loading branch information
SpikeHD committed Sep 26, 2023
1 parent 5704be2 commit 2f8bd01
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions backend/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ struct Args {
/// Password to use for authentication. Not reccommended, use the prompt instead
#[arg(short = 'k', long)]
password: Option<String>,

/// Access address
#[arg(short = 'a', long, default_value = "127.0.0.1")]
address: String,
}

fn main() {
Expand Down Expand Up @@ -142,13 +146,14 @@ fn main() {
println!("Retaining {} of CPU history", args.cpu_history_max);
println!("Updating every {} seconds", args.update_rate);
println!(
"Done! Access the web interface at http://localhost:{}/",
"Done! Access the web interface at http://{}:{}/",
args.address,
args.port
);

task::block_on(async {
app
.listen(format!("127.0.0.1:{}", args.port))
.listen(format!("{}:{}", args.address, args.port))
.await
.unwrap();
})
Expand Down

0 comments on commit 2f8bd01

Please sign in to comment.