Refactor asset and logging directory creation for improved clarity

This commit is contained in:
2026-01-06 14:34:31 +01:00
parent 10384d15e5
commit c6eba691a8
3 changed files with 5 additions and 10 deletions

View File

@@ -8,7 +8,7 @@ use actix_web::{
web::{self},
};
use serde_json::Value;
use std::path::PathBuf;
use std::{fs, path::PathBuf};
pub static BIND_ADDR: &str = "0.0.0.0";
pub static BIND_PORT: u16 = 80;
@@ -56,6 +56,9 @@ async fn catch_all(req: HttpRequest, _payload: Option<web::Json<Value>>) -> acti
#[actix_web::main]
async fn main() -> std::io::Result<()> {
let _ = fs::create_dir_all(DATA_STORAGE);
let _ = fs::create_dir_all(LOG_DIR);
println!("Starting server at http://{}:{}/", BIND_ADDR, BIND_PORT);
tokio::spawn(async {
let mut interval = tokio::time::interval(tokio::time::Duration::from_secs(60));