diff --git a/index.html b/index.html index 10fea4f..e4e2f2d 100644 --- a/index.html +++ b/index.html @@ -4,7 +4,7 @@ Yarrr - + diff --git a/run.sh b/run.sh index 1654ffb..6bf213d 100755 --- a/run.sh +++ b/run.sh @@ -1,4 +1,4 @@ #!/bin/bash #trunk build ./index.html && cargo run --bin backend -- localhost:7534 -trunk build ./index.html && cargo run --bin backend -- localhost:7534 --dir /mnt/nas/media -u user -p password +trunk build ./index.html && cargo run --bin backend -- localhost:7534 --dir /mnt/nas/media -u user -p password --port 7534 diff --git a/src/api/get_args.rs b/src/api/get_args.rs index 0907733..d4c8698 100644 --- a/src/api/get_args.rs +++ b/src/api/get_args.rs @@ -23,6 +23,9 @@ pub struct CliArgs { /// Display hidden files #[clap(short, long)] pub hidden: bool, + /// Local network port + #[clap(long)] + pub port: u16, } impl CliArgs { diff --git a/src/bin/backend.rs b/src/bin/backend.rs index 250305b..9c85dab 100644 --- a/src/bin/backend.rs +++ b/src/bin/backend.rs @@ -26,7 +26,7 @@ async fn main() -> std::io::Result<()> { .service(dir) .service(file) }) - .bind(("127.0.0.1", 7534))? + .bind(("127.0.0.1", args.port))? .run() .await } else { @@ -39,7 +39,7 @@ async fn main() -> std::io::Result<()> { .service(dir) .service(file) }) - .bind(("127.0.0.1", 7534))? + .bind(("127.0.0.1", args.port))? .run() .await }