# HG changeset patch # User Dang Hoang Tuan (Tsuki) # Date 1657763021 -25200 # Thu Jul 14 08:43:41 2022 +0700 # Node ID 2802c07ab54fe7f9d1aca7ad15180f91af591985 # Parent 9ce12452288e3ec4690e6a5db175470b88c35265 We still need ACCESSIBLE_DIR though diff --git a/consts.go b/consts.go --- a/consts.go +++ b/consts.go @@ -22,5 +22,6 @@ /?path=def/abc.txt ` +var ACCESSIBLE_DIR = "./" var spf = fmt.Sprintf var sp = fmt.Sprint diff --git a/server.go b/server.go --- a/server.go +++ b/server.go @@ -28,6 +28,9 @@ } func serve(port int, dir string) { + if dir != "" { + ACCESSIBLE_DIR = dir + } e := echo.New() e.GET("/", index) e.Logger.Fatal(e.Start(spf(":%d", port)))