sxyprn
This commit is contained in:
@@ -10,6 +10,7 @@ use ntex_files as fs;
|
||||
use ntex::web;
|
||||
|
||||
mod api;
|
||||
mod proxy;
|
||||
mod db;
|
||||
mod models;
|
||||
mod providers;
|
||||
@@ -17,6 +18,7 @@ mod schema;
|
||||
mod status;
|
||||
mod util;
|
||||
mod videos;
|
||||
mod proxies;
|
||||
|
||||
type DbPool = r2d2::Pool<ConnectionManager<SqliteConnection>>;
|
||||
|
||||
@@ -43,7 +45,7 @@ async fn main() -> std::io::Result<()> {
|
||||
.expect("Failed to create pool.");
|
||||
|
||||
let mut requester = util::requester::Requester::new();
|
||||
requester.set_proxy(env::var("PROXY").unwrap_or("0".to_string()) == "1".to_string());
|
||||
requester.set_proxy(env::var("PROXY").unwrap_or("0".to_string()) != "0".to_string());
|
||||
|
||||
let cache: util::cache::VideoCache = crate::util::cache::VideoCache::new();
|
||||
|
||||
@@ -55,6 +57,7 @@ async fn main() -> std::io::Result<()> {
|
||||
.state(requester.clone())
|
||||
.wrap(web::middleware::Logger::default())
|
||||
.service(web::scope("/api").configure(api::config))
|
||||
.service(web::scope("/proxy").configure(proxy::config))
|
||||
.service(
|
||||
web::resource("/")
|
||||
.route(web::get().to(|| async {
|
||||
|
||||
Reference in New Issue
Block a user