* Add --bind option

* Changed default bind address to localhost
* Fix wrong log text about binding address
This commit is contained in:
FixFromDarkness 2022-07-07 19:45:31 +03:00
parent 73ec59ccda
commit cc2dd1e1fe
2 changed files with 9 additions and 4 deletions

View file

@ -58,7 +58,8 @@ async fn main() -> std::io::Result<()> {
.init();
log::info!(
"MicroBin starting on http://127.0.0.1:{}",
"MicroBin starting on http://{}:{}",
ARGS.bind.to_string(),
ARGS.port.to_string()
);
@ -97,7 +98,7 @@ async fn main() -> std::io::Result<()> {
HttpAuthentication::basic(util::auth::auth_validator),
))
})
.bind(format!("0.0.0.0:{}", ARGS.port.to_string()))?
.bind((ARGS.bind, ARGS.port))?
.workers(ARGS.threads as usize)
.run()
.await