add very basic logging

This commit is contained in:
SadlyNotSappho 2023-05-05 16:48:13 -07:00
parent fc0a0cb936
commit 8db4706786
1 changed files with 3 additions and 3 deletions

View File

@ -37,9 +37,11 @@ async fn main() -> tide::Result<()> {
"{}/{}/{}/index.html", "{}/{}/{}/index.html",
webdirs, root_name, index_paths webdirs, root_name, index_paths
))?; ))?;
println!("registered /")
} }
for d in subdirs { for d in subdirs {
println!("registered /{d}");
app.at(d.as_str()) app.at(d.as_str())
.serve_file(format!("{}/{}/{}/index.html", webdirs, d, index_paths))?; .serve_file(format!("{}/{}/{}/index.html", webdirs, d, index_paths))?;
} }
@ -48,9 +50,7 @@ async fn main() -> tide::Result<()> {
} }
fn get_env(option: &str) -> Option<String> { fn get_env(option: &str) -> Option<String> {
/* // Get the env var from .env, but if it isn't there, or if the file doesn't exist, get it from the actual env vars
* Get the env var from .env, but if it isn't there, or if the file doesn't exist, get it from the actual env vars
*/
let text_some = std::fs::read_to_string("./.env").ok(); let text_some = std::fs::read_to_string("./.env").ok();
if let Some(text) = text_some { if let Some(text) = text_some {
for line in text.trim().lines().collect::<Vec<&str>>() { for line in text.trim().lines().collect::<Vec<&str>>() {