now displaying the set port when serving

This commit is contained in:
2023-03-14 22:39:28 +01:00
parent b9f37cfe47
commit c2cbe559a7
2 changed files with 7 additions and 2 deletions

View File

@@ -22,7 +22,12 @@ async fn watch_and_build() {
}
async fn start_server(port: Option<u16>) {
println!("\nServing at {} ", "http://localhost:8080".bold());
let unwrapped_port = port.unwrap_or(8080);
println!(
"\nServing at {}{} ",
"http://localhost:".bold(),
unwrapped_port.to_string().bold()
);
let Ok(()) = listen("localhost", port.unwrap_or(8080), "./dist").await else {
panic!("could not start server")