Compare commits
	
		
			2 commits
		
	
	
		
			251fbbb286
			...
			9229142a18
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
							 | 
						9229142a18 | ||
| 
							 | 
						a223373fc1 | 
					 1 changed files with 8 additions and 3 deletions
				
			
		
							
								
								
									
										11
									
								
								src/main.rs
									
										
									
									
									
								
							
							
						
						
									
										11
									
								
								src/main.rs
									
										
									
									
									
								
							| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
use actix_web::{App, HttpServer, web::Data};
 | 
					use actix_web::{App, HttpServer, web::Data};
 | 
				
			||||||
use dotenvy::dotenv;
 | 
					use dotenvy::dotenv;
 | 
				
			||||||
use tracing::Level;
 | 
					use tracing::{Level, debug};
 | 
				
			||||||
use tracing_subscriber::FmtSubscriber;
 | 
					use tracing_subscriber::FmtSubscriber;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
mod access;
 | 
					mod access;
 | 
				
			||||||
| 
						 | 
					@ -15,7 +15,10 @@ async fn main() -> std::io::Result<()> {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    tracing::subscriber::set_global_default(subscriber).expect("Could not initialize logging.");
 | 
					    tracing::subscriber::set_global_default(subscriber).expect("Could not initialize logging.");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    dotenv().expect("Could not load .env file.");
 | 
					    let dr = dotenv();
 | 
				
			||||||
 | 
					    if let Err(e) = dr {
 | 
				
			||||||
 | 
					        debug!("Could not load .env file: {}", e);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    let config = config::load_config();
 | 
					    let config = config::load_config();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -28,7 +31,9 @@ async fn main() -> std::io::Result<()> {
 | 
				
			||||||
                .service(handlers::get_cache_item)
 | 
					                .service(handlers::get_cache_item)
 | 
				
			||||||
                .service(handlers::put_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()]) {
 | 
					    for bind_address in config.bind_addresses.unwrap_or(vec!["::0".to_string()]) {
 | 
				
			||||||
        server = server
 | 
					        server = server
 | 
				
			||||||
            .bind((bind_address.clone(), 8080))
 | 
					            .bind((bind_address.clone(), 8080))
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue