diff --git a/cmd/dwelling-files/main.go b/cmd/dwelling-files/main.go index 7e9a70c..7ee4a8e 100644 --- a/cmd/dwelling-files/main.go +++ b/cmd/dwelling-files/main.go @@ -1,8 +1,7 @@ package main import ( - "dwelling-files/internal/handlers" - "dwelling-files/internal/server" + "dwelling-files/internal/http" "dwelling-files/web" "flag" "fmt" @@ -47,8 +46,8 @@ func main() { } } - hand := handlers.New(directoryPath, web.Assets(), !*enableFileHandler) - srv := server.NewHttpServer() + hand := http.New(directoryPath, web.Assets(), !*enableFileHandler) + srv := http.NewHttpServer() srv.GET("/*filepath", hand.Index) diff --git a/internal/handlers/handlers.go b/internal/http/handlers.go similarity index 92% rename from internal/handlers/handlers.go rename to internal/http/handlers.go index 17d84fa..d8ff164 100644 --- a/internal/handlers/handlers.go +++ b/internal/http/handlers.go @@ -1,7 +1,6 @@ -package handlers +package http import ( - "dwelling-files/internal/server" "dwelling-files/pkg/files" "dwelling-files/pkg/utils" "dwelling-files/web" @@ -38,7 +37,7 @@ func (FilesHandlers) AssetsFS() http.FileSystem { } func (h *FilesHandlers) Index(w http.ResponseWriter, r *http.Request) { - path := httprouter.CleanPath(server.GetURLParam(r, "filepath")) + path := httprouter.CleanPath(GetURLParam(r, "filepath")) if strings.HasPrefix(path, "/assets") { h.assetsServer.ServeHTTP(w, r) diff --git a/internal/server/http.go b/internal/http/http.go similarity index 98% rename from internal/server/http.go rename to internal/http/http.go index 4322ba9..58c3af4 100644 --- a/internal/server/http.go +++ b/internal/http/http.go @@ -1,4 +1,4 @@ -package server +package http import ( "context"