use different ports for dev and live modes

This commit is contained in:
Joseph Montanaro
2022-12-21 16:22:24 -08:00
parent bf4c46238e
commit 398916fe10
2 changed files with 12 additions and 4 deletions

View File

@ -10,10 +10,17 @@ pub struct AppConfig {
impl Default for AppConfig {
fn default() -> Self {
let listen_port = if cfg!(debug_assertions) {
12_345
}
else {
19_923
};
AppConfig {
db_path: get_or_create_db_path(),
listen_addr: Ipv4Addr::LOCALHOST,
listen_port: 19_923
listen_port,
}
}
}
@ -31,7 +38,7 @@ fn get_or_create_db_path() -> PathBuf {
p
})
.unwrap_or(PathBuf::from("."));
parent.push("creddy.db");
parent.push("creddy.db");
parent
}