blob: 5d1ffd53a5f3fc064211e2df688403f3e8011889 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
.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
|