Server API v1 #1

Merged
luke merged 30 commits from development into main 2024-05-04 20:22:45 +00:00
Showing only changes of commit d7e5dd7df4 - Show all commits

View File

@ -29,13 +29,15 @@ async fn main() -> io::Result<()> {
if let Ok(env_port) = env::var("PORT") { if let Ok(env_port) = env::var("PORT") {
if let Ok(env_port) = env_port.parse::<u16>() { if let Ok(env_port) = env_port.parse::<u16>() {
port = env_port; port = env_port;
} else { } else if !env_port.is_empty() {
util::warn_println("Failed to parse PORT env variable; using default value."); util::warn_println("Failed to parse PORT env variable; using default value.");
} }
} }
if let Ok(env_addr) = env::var("BIND_ADDR") { if let Ok(env_addr) = env::var("BIND_ADDR") {
bind_addr = env_addr; if !env_addr.is_empty() {
bind_addr = env_addr;
}
} }
util::notice_println("Connecting to DB."); util::notice_println("Connecting to DB.");