From 1b62d8ddc241a05e2827c9aba403f29613560636 Mon Sep 17 00:00:00 2001 From: Marco Pasqualetti <24919330+marcalexiei@users.noreply.github.com> Date: Fri, 6 Dec 2024 13:05:24 +0100 Subject: [PATCH] refactor(crates/tuono): build - ssg - disable `zombie_processes` warning and use `TUONO_PORT` to generate server URL (#199) --- Cargo.toml | 2 +- crates/tuono/src/cli.rs | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 6f543623..8d0989c5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,7 @@ members = [ ] exclude = [ "apps/documentation", - "examples/wit-mdx", + "examples/with-mdx", "examples/tuono-app", "examples/tuono-tutorial", "benches/tuono" diff --git a/crates/tuono/src/cli.rs b/crates/tuono/src/cli.rs index 2029d7dc..0cb64458 100644 --- a/crates/tuono/src/cli.rs +++ b/crates/tuono/src/cli.rs @@ -133,6 +133,8 @@ pub fn app() -> std::io::Result<()> { ) .expect("Failed to clone assets into static output folder"); + // the process is killed below so we don't really need to use wait() function + #[allow(clippy::zombie_processes)] let mut rust_server = app.run_rust_server(); let reqwest = reqwest::blocking::Client::builder() @@ -144,7 +146,8 @@ pub fn app() -> std::io::Result<()> { let mut is_server_ready = false; while !is_server_ready { - if reqwest.get("http://localhost:3000").send().is_ok() { + let server_url = format!("http://localhost:{}", TUONO_PORT); + if reqwest.get(server_url).send().is_ok() { is_server_ready = true } // TODO: add maximum tries