Add some features

This commit is contained in:
2023-09-13 11:45:24 +02:00
parent 760decfb85
commit 9e7f716be8
7 changed files with 485 additions and 48 deletions

22
serve.go Normal file
View File

@ -0,0 +1,22 @@
package main
import (
"fmt"
"github.com/kataras/iris/v12"
)
func Serve(root string, port uint) error {
app := iris.New()
app.HandleDir("/", iris.Dir(root), iris.DirOptions{
IndexName: "/index.html",
Compress: false,
ShowList: true,
ShowHidden: true,
Cache: iris.DirCacheOptions{
Enable: false,
},
})
return app.Listen(fmt.Sprintf(":%d", port))
}