cmd/stepd: Add ability to specify error document

This commit is contained in:
Sasha Koshka 2024-12-07 03:11:12 -05:00
parent a7b360cc09
commit 006a311aeb

View File

@ -21,6 +21,10 @@ func main () {
'a', "address",
"The address to host the server on",
":8080", cli.ValString)
flagErrorDocument := cli.NewInputFlag (
0, "error-document",
"The document to use for displaying errors",
"", cli.ValString)
flagDirectories := cli.NewFlag (
'd', "directories",
"Serve the contents of directories")
@ -47,10 +51,11 @@ func main () {
// set up the HTTP handler
handler := stephttp.Handler {
Environment: &environment,
Directories: flagDirectories.Value == "true",
StepExt: ucontainer.NewSet(".step"),
Index: []string { "index.step", "index.html", "index" },
Environment: &environment,
Directories: flagDirectories.Value == "true",
StepExt: ucontainer.NewSet(".step"),
Index: []string { "index.step", "index.html", "index" },
ErrorDocument: flagErrorDocument.Value,
}
// set up the HTTP server