From ec509e46c57d299350fea56333d0a26bd28e1460 Mon Sep 17 00:00:00 2001 From: Federico Ragona Date: Tue, 2 Jul 2024 06:27:16 +0200 Subject: [PATCH] feat: deploy as Vercel function --- internal/handler.go => api/bookmark.go | 2 +- cmd/server/main.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) rename internal/handler.go => api/bookmark.go (99%) diff --git a/internal/handler.go b/api/bookmark.go similarity index 99% rename from internal/handler.go rename to api/bookmark.go index 44f9422..0a86c24 100644 --- a/internal/handler.go +++ b/api/bookmark.go @@ -1,4 +1,4 @@ -package internal +package api import ( "fmt" diff --git a/cmd/server/main.go b/cmd/server/main.go index e8e7447..2e7969e 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -14,6 +14,7 @@ import ( "github.com/go-chi/chi/v5/middleware" "github.com/kelseyhightower/envconfig" + "github.com/fedragon/bookmd/api" "github.com/fedragon/bookmd/internal" ) @@ -25,7 +26,7 @@ func main() { router := chi.NewRouter() router.Use(middleware.Logger) - router.Get("/bookmarks", internal.Handle) + router.Get("/bookmarks", api.Handle) server := &http.Server{Addr: config.HttpAddress, Handler: router} serverCtx, serverStopCtx := context.WithCancel(context.Background())