diff --git a/src/main.rs b/src/main.rs index a68e06d..44fb1b0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -35,7 +35,7 @@ async fn main() -> eyre::Result<()> { Mode::Build => { build(site)?; } - Mode::Serve => site.serve().await?, + Mode::Serve => site.serve("127.0.0.1:8080").await?, Mode::Now => { let time = OffsetDateTime::now_utc(); println!( diff --git a/src/serving.rs b/src/serving.rs index 69c7da2..2734d55 100644 --- a/src/serving.rs +++ b/src/serving.rs @@ -147,8 +147,8 @@ fn skip_path(builder: &SiteBuilder, path: &Path) -> bool { impl Site { /// Serves the site for development. Don't use this in production. - pub async fn serve(self) -> eyre::Result<()> { - let addr = SocketAddr::from(([127, 0, 0, 1], 8080)); + pub async fn serve(self, addr: &str) -> eyre::Result<()> { + let addr: SocketAddr = addr.parse()?; let mut builder = SiteBuilder::new(self, true)?.prepare()?; let site = &builder.site;