Compare commits
4 commits
2ae702adc2
...
9333574de2
| Author | SHA1 | Date | |
|---|---|---|---|
| 9333574de2 | |||
| 7014763271 | |||
| 5b11318d76 | |||
| f567a2eb83 |
3 changed files with 24 additions and 15 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -2,3 +2,5 @@
|
|||
tmp
|
||||
indir
|
||||
indir-*
|
||||
.zed
|
||||
index.html
|
||||
|
|
|
|||
7
main.go
7
main.go
|
|
@ -172,6 +172,13 @@ func main() {
|
|||
return
|
||||
}
|
||||
|
||||
// serve index.html if present (case-sensitive)
|
||||
indexPath := filepath.Join(fpath, "index.html")
|
||||
if _, err := os.Stat(indexPath); err == nil {
|
||||
http.ServeFile(w, r, indexPath)
|
||||
return
|
||||
}
|
||||
|
||||
// embeded readme
|
||||
var readmeHTML template.HTML
|
||||
entries, err := os.ReadDir(fpath)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue