Skip to content

Commit

Permalink
suggest connecting from localhost
Browse files Browse the repository at this point in the history
  • Loading branch information
lovasoa committed Jun 14, 2024
1 parent b4e85b7 commit 1a737f2
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use std::fmt::Write;

use sqlpage::{
app_config::{self, AppConfig},
webserver, AppState,
Expand Down Expand Up @@ -32,13 +34,12 @@ async fn log_welcome_message(config: &AppConfig) {
format!("https://{}", domain)
} else {
let listen_on = config.listen_on();
let msg = if listen_on.ip().is_unspecified() {
let mut msg = format!("{listen_on}");
if listen_on.ip().is_unspecified() {
// let the user know the service is publicly accessible
" (accessible on all networks of this computer)"
} else {
""
};
format!("http://{listen_on}{msg}")
write!(msg, ": accessible from the network and from this computer on http://localhost:{}", listen_on.port()).unwrap();
}
msg
};

log::info!(
Expand Down

0 comments on commit 1a737f2

Please sign in to comment.