cmd/stepd: Add ability to specify error document
This commit is contained in:
parent
a7b360cc09
commit
006a311aeb
@ -21,6 +21,10 @@ func main () {
|
|||||||
'a', "address",
|
'a', "address",
|
||||||
"The address to host the server on",
|
"The address to host the server on",
|
||||||
":8080", cli.ValString)
|
":8080", cli.ValString)
|
||||||
|
flagErrorDocument := cli.NewInputFlag (
|
||||||
|
0, "error-document",
|
||||||
|
"The document to use for displaying errors",
|
||||||
|
"", cli.ValString)
|
||||||
flagDirectories := cli.NewFlag (
|
flagDirectories := cli.NewFlag (
|
||||||
'd', "directories",
|
'd', "directories",
|
||||||
"Serve the contents of directories")
|
"Serve the contents of directories")
|
||||||
@ -47,10 +51,11 @@ func main () {
|
|||||||
|
|
||||||
// set up the HTTP handler
|
// set up the HTTP handler
|
||||||
handler := stephttp.Handler {
|
handler := stephttp.Handler {
|
||||||
Environment: &environment,
|
Environment: &environment,
|
||||||
Directories: flagDirectories.Value == "true",
|
Directories: flagDirectories.Value == "true",
|
||||||
StepExt: ucontainer.NewSet(".step"),
|
StepExt: ucontainer.NewSet(".step"),
|
||||||
Index: []string { "index.step", "index.html", "index" },
|
Index: []string { "index.step", "index.html", "index" },
|
||||||
|
ErrorDocument: flagErrorDocument.Value,
|
||||||
}
|
}
|
||||||
|
|
||||||
// set up the HTTP server
|
// set up the HTTP server
|
||||||
|
Loading…
Reference in New Issue
Block a user