caching
This commit is contained in:
@@ -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"))
|
||||
|
||||
Reference in New Issue
Block a user