aboutsummaryrefslogtreecommitdiff
path: root/server.go
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2024-03-21 15:26:53 +0700
committerShulhan <ms@kilabit.info>2024-03-21 15:26:53 +0700
commitaed750e52ceccc18e3143995d43b0b1de21055b9 (patch)
treebf99213ee6ffb05fdcf04f2807bd6866f7a011ca /server.go
parent8a9875b04ea369039b22c1d9d6ff260506cf35fb (diff)
downloadciigo-aed750e52ceccc18e3143995d43b0b1de21055b9.tar.xz
all: add server option to automatically generate index HTML
If the requested path is directory and no "index.html" file exist in that directory, ciigo server will render list of files as "index.html" automatically.
Diffstat (limited to 'server.go')
-rw-r--r--server.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/server.go b/server.go
index 3a90a87..1d48e7e 100644
--- a/server.go
+++ b/server.go
@@ -47,8 +47,9 @@ func newServer(opts *ServeOptions) (srv *server, err error) {
}
var httpdOpts = libhttp.ServerOptions{
- Memfs: opts.Mfs,
- Address: opts.Address,
+ Memfs: opts.Mfs,
+ Address: opts.Address,
+ EnableIndexHTML: opts.EnableIndexHTML,
}
srv.http, err = libhttp.NewServer(httpdOpts)