33 lines
766 B
Rust
33 lines
766 B
Rust
use ntex_files as fs;
|
|
|
|
use ntex::web;
|
|
use ntex::web::HttpResponse;
|
|
use serde::Deserialize;
|
|
use serde_json::{json};
|
|
use std::thread;
|
|
use std::time::Duration;
|
|
mod api;
|
|
mod status;
|
|
mod videos;
|
|
mod providers;
|
|
mod util;
|
|
|
|
#[ntex::main]
|
|
async fn main() -> std::io::Result<()> {
|
|
std::env::set_var("RUST_LOG", "ntex=warn");
|
|
std::env::set_var("RUST_BACKTRACE", "1");
|
|
env_logger::init(); // You need this to actually see logs
|
|
|
|
|
|
web::HttpServer::new(|| {
|
|
web::App::new()
|
|
.wrap(web::middleware::Logger::default())
|
|
.service(web::scope("/api").configure(api::config))
|
|
.service(fs::Files::new("/", "static"))
|
|
})
|
|
// .bind_openssl(("0.0.0.0", 18080), builder)?
|
|
.bind(("0.0.0.0", 18080))?
|
|
.run()
|
|
.await
|
|
}
|