.Dd January 2, 2026 .Dt SSG-SERVE 1 .Os .Sh NAME .Nm ssg-serve .Nd serve the built static site locally .Sh SYNOPSIS .Nm ssg serve .Op Fl h | -help .Op Fl d | -dir Ar dir .Op Fl p | -port Ar port .Sh DESCRIPTION .Nm starts a local HTTP server at .Lk http://localhost:8080 to preview the built site. .Pp It is assumed that you have run .Xr ssg-build 1 first. If not, the output directory may not exist and while the HTTP server will start up, any request to the server will result in a 404 Not Found. .Sh OPTIONS .Bl -tag -width Ds .It Fl h , Fl -help Print brief usage information. .It Fl d Ar dir , Fl -dir Ar dir Relative path to a directory to serve. Default: dist .It Fl p Ar port , Fl -port Ar port Port to listen on. Default: 8080 .El .Sh EXIT STATUS .Nm exits 0 on success, and >0 if an error occurs. .Sh EXAMPLES Serve the default output directory on the default port: .Dl $ ssg serve .Pp Serve on a different port: .Dl $ ssg serve --port 9000 .Pp Serve on a different output directory: .Dl $ ssg serve --dir build/ .Pp Build and serve: .Dl $ ssg build && ssg serve .Pp .Sh SEE ALSO .Xr ssg 1 , .Xr ssg-build 1