Compare commits
	
		
			No commits in common. "9229142a18c25dfee62add0168568667cd42c8f5" and "251fbbb2861eadcf75faa7386cc8a794d08b08e7" have entirely different histories.
		
	
	
		
			9229142a18
			...
			251fbbb286
		
	
		
					 1 changed files with 3 additions and 8 deletions
				
			
		
							
								
								
									
										11
									
								
								src/main.rs
									
										
									
									
									
								
							
							
						
						
									
										11
									
								
								src/main.rs
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -1,6 +1,6 @@
 | 
			
		|||
use actix_web::{App, HttpServer, web::Data};
 | 
			
		||||
use dotenvy::dotenv;
 | 
			
		||||
use tracing::{Level, debug};
 | 
			
		||||
use tracing::Level;
 | 
			
		||||
use tracing_subscriber::FmtSubscriber;
 | 
			
		||||
 | 
			
		||||
mod access;
 | 
			
		||||
| 
						 | 
				
			
			@ -15,10 +15,7 @@ async fn main() -> std::io::Result<()> {
 | 
			
		|||
 | 
			
		||||
    tracing::subscriber::set_global_default(subscriber).expect("Could not initialize logging.");
 | 
			
		||||
 | 
			
		||||
    let dr = dotenv();
 | 
			
		||||
    if let Err(e) = dr {
 | 
			
		||||
        debug!("Could not load .env file: {}", e);
 | 
			
		||||
    }
 | 
			
		||||
    dotenv().expect("Could not load .env file.");
 | 
			
		||||
 | 
			
		||||
    let config = config::load_config();
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -31,9 +28,7 @@ async fn main() -> std::io::Result<()> {
 | 
			
		|||
                .service(handlers::get_cache_item)
 | 
			
		||||
                .service(handlers::put_cache_item)
 | 
			
		||||
        }
 | 
			
		||||
    })
 | 
			
		||||
    .keep_alive(None); // disable HTTP keep-alive because it seems to break NX (at least in version 20.8)
 | 
			
		||||
 | 
			
		||||
    });
 | 
			
		||||
    for bind_address in config.bind_addresses.unwrap_or(vec!["::0".to_string()]) {
 | 
			
		||||
        server = server
 | 
			
		||||
            .bind((bind_address.clone(), 8080))
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue