Skip to content

Commit

Permalink
Listen on ipv6 as well
Browse files Browse the repository at this point in the history
  • Loading branch information
jenniferkramerusds committed Jul 8, 2024
1 parent 3a17b57 commit ee0b1de
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion rustpad-server/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use rustpad_server::{server, database::Database, ServerConfig};
use std::net::IpAddr;

#[tokio::main]
async fn main() {
Expand All @@ -10,6 +11,8 @@ async fn main() {
.parse()
.expect("Unable to parse PORT");

let addr = IpAddr::from([0; 8]);

let config = ServerConfig {
expiry_days: std::env::var("EXPIRY_DAYS")
.unwrap_or_else(|_| String::from("1"))
Expand All @@ -25,5 +28,5 @@ async fn main() {
},
};

warp::serve(server(config)).run(([0, 0, 0, 0], port)).await;
warp::serve(server(config)).run((addr, port)).await;
}

0 comments on commit ee0b1de

Please sign in to comment.