We still need ACCESSIBLE_DIR though
2 files changed, 4 insertions(+), 0 deletions(-) M consts.go M server.go
M consts.go +1 -0
@@ 22,5 22,6 @@ be: /?path=def/abc.txt ` +var ACCESSIBLE_DIR = "./" var spf = fmt.Sprintf var sp = fmt.Sprint
M server.go +3 -0
@@ 28,6 28,9 @@ func index(c echo.Context) error { } 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)))