From 9dbf9060b8b2cfb39b5c5ae5babf8ab2e65723c7 Mon Sep 17 00:00:00 2001 From: serxoz Date: Fri, 20 Jan 2023 21:45:43 +0100 Subject: [PATCH] nombre da libreria e do binario --- Cargo.toml | 8 ++++++++ src/main.rs | 2 +- src/views/astronaves.rs | 2 +- src/views/personajes.rs | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index a03bf83..57b5a92 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,3 +15,11 @@ serde_json = { version = "1.0" } serde_with = "2.0" rand = "0.8.5" minijinja = "0.30.0" + +[lib] +name = "itkg_lib" +path = "src/lib.rs" + +[[bin]] +name = "itkg" +path = "src/main.rs" diff --git a/src/main.rs b/src/main.rs index a93b62b..63ba8ac 100644 --- a/src/main.rs +++ b/src/main.rs @@ -17,7 +17,7 @@ async fn main() { .route("/astronaves", get(genera_astronave)); // executase con hyper a través de axum::Server - let addr = SocketAddr::from(([127, 0, 0, 1], into_the_kosmos_generador::env_listen_port())); + let addr = SocketAddr::from(([127, 0, 0, 1], itkg_lib::env_listen_port())); tracing::debug!("listening on {}", addr); axum::Server::bind(&addr) .serve(app.into_make_service()) diff --git a/src/views/astronaves.rs b/src/views/astronaves.rs index f856248..1f5b77b 100644 --- a/src/views/astronaves.rs +++ b/src/views/astronaves.rs @@ -52,7 +52,7 @@ pub async fn genera_astronave() -> Html { ], }; - let path = format!("{}/astronave.html", into_the_kosmos_generador::env_templates_dir()); + let path = format!("{}/astronave.html", itkg_lib::env_templates_dir()); let template = fs::read_to_string(path).unwrap(); let r = render!(&template, astronave => ast); Html(r) diff --git a/src/views/personajes.rs b/src/views/personajes.rs index 63448bd..9662755 100644 --- a/src/views/personajes.rs +++ b/src/views/personajes.rs @@ -35,7 +35,7 @@ pub async fn genera_pj() -> Html { equipo: trasf.equipo, }; - let path = format!("{}/personaje.html", into_the_kosmos_generador::env_templates_dir()); + let path = format!("{}/personaje.html", itkg_lib::env_templates_dir()); let template = fs::read_to_string(path).unwrap(); let r = render!(&template, personaje => pj); Html(r)