package main import ( "errors" "fmt" "log" "os" "github.com/labstack/echo/v4" "github.com/labstack/echo/v4/middleware" ) func main() { _, err := os.Stat("storage") if errors.Is(err, os.ErrNotExist) { err2 := os.Mkdir("storage", 0775) if err2 != nil { log.Panic(map[string]error{ "err": err2, "cause": err, }) } } E := echo.New() E.Use(middleware.CORS()) E.GET("/", MainHandle) // / (Mostly version info, lists valid dirs) E.GET("/dir", GetDirHandle) // /dir?q=