From 2dd4cf35aab8324608a83d337459fd8354521b92 Mon Sep 17 00:00:00 2001 From: "Gabriel A. Giovanini" Date: Mon, 27 May 2024 22:36:50 +0200 Subject: feat: Wraps handler into its own package Although this creates more complex folder structure will allow in the feature for a easier testing of those given handlers. --- pkg/handler/static.go | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 pkg/handler/static.go (limited to 'pkg/handler/static.go') diff --git a/pkg/handler/static.go b/pkg/handler/static.go deleted file mode 100644 index 9f312f4..0000000 --- a/pkg/handler/static.go +++ /dev/null @@ -1,18 +0,0 @@ -package handler - -import ( - "io/fs" - "net/http" - - "git.gabrielgio.me/cerrado/static" -) - -func NewStaticHander(prefix string) (http.Handler, error) { - staticFs, err := fs.Sub(static.Static, ".") - if err != nil { - return nil, err - } - - handler := http.StripPrefix(prefix, http.FileServer(http.FS(staticFs))) - return handler, nil -} -- cgit v1.2.3