This commit is contained in:
Simon
2025-06-04 07:35:55 +00:00
parent 8d5da3a4dc
commit 3150e57411
7 changed files with 105 additions and 12 deletions

View File

@@ -1,6 +1,5 @@
#![allow(non_snake_case)]
use ntex_files as fs;
use ntex::web;
mod api;
mod status;
@@ -14,9 +13,11 @@ async fn main() -> std::io::Result<()> {
std::env::set_var("RUST_BACKTRACE", "1");
env_logger::init(); // You need this to actually see logs
let cache: util::cache::VideoCache = crate::util::cache::VideoCache::new();
web::HttpServer::new(|| {
web::HttpServer::new(move || {
web::App::new()
.state(cache.clone())
.wrap(web::middleware::Logger::default())
.service(web::scope("/api").configure(api::config))
.service(fs::Files::new("/", "static"))