nombre da libreria e do binario

This commit is contained in:
serxoz 2023-01-20 21:45:43 +01:00
parent 472a10e74d
commit 9dbf9060b8
4 changed files with 11 additions and 3 deletions

View File

@ -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"

View File

@ -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())

View File

@ -52,7 +52,7 @@ pub async fn genera_astronave() -> Html<String> {
],
};
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)

View File

@ -35,7 +35,7 @@ pub async fn genera_pj() -> Html<String> {
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)