diff --git a/cmd/dwelling-upload/main.go b/cmd/dwelling-upload/main.go index 48b1372..c897297 100644 --- a/cmd/dwelling-upload/main.go +++ b/cmd/dwelling-upload/main.go @@ -94,7 +94,7 @@ func main() { http.Error(w, r, nethttp.StatusNotFound, "") }) - srv.ServeStatic("/assets/*filepath", hand.AssetsFS()) + srv.ServeStatic("/assets/*filepath", http.AssetsFS()) srv.GET("/robots.txt", http.RobotsTxt) srv.GET("/favicon.svg", http.Favicon) diff --git a/internal/http/handlers.go b/internal/http/handlers.go index 455b310..ffd5893 100644 --- a/internal/http/handlers.go +++ b/internal/http/handlers.go @@ -42,10 +42,6 @@ func NewUploadHandlers(lFile *log.Logger, uploadDir string, uploadDirSize *int64 limitFileSize: limFileSz} } -func (*UploadHandlers) AssetsFS() http.FileSystem { - return web.Assets() -} - func (h *UploadHandlers) Index(w http.ResponseWriter, r *http.Request) { var storCapacity int64 = h.limitStorage << 20 var fMaxSize int64 = h.limitFileSize << 20 @@ -237,6 +233,10 @@ func Error(w http.ResponseWriter, r *http.Request, code int, reason string) { web.ErrorXXX(utils.MainSite(r.Host), code, reason, w) } +func AssetsFS() http.FileSystem { + return web.Assets() +} + func RobotsTxt(w http.ResponseWriter, r *http.Request) { data, _ := web.AssetsGetFile("robots.txt") w.Write(data)