Refactor asset and logging directory creation for improved clarity
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user