From d113f02d90adb06892fa5dee00dd74c55ae47f78 Mon Sep 17 00:00:00 2001 From: niku Date: Sat, 22 Jul 2023 14:28:49 +0200 Subject: [PATCH] Fix wrong go types --- .../internal/{routes => app}/api/router.go | 6 +++--- .../internal/{routes => app}/api/v1/router.go | 0 .../internal/{routes => app}/main.go | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) rename {{cookiecutter.project_name}}/internal/{routes => app}/api/router.go (61%) rename {{cookiecutter.project_name}}/internal/{routes => app}/api/v1/router.go (100%) rename {{cookiecutter.project_name}}/internal/{routes => app}/main.go (82%) diff --git a/{{cookiecutter.project_name}}/internal/routes/api/router.go b/{{cookiecutter.project_name}}/internal/app/api/router.go similarity index 61% rename from {{cookiecutter.project_name}}/internal/routes/api/router.go rename to {{cookiecutter.project_name}}/internal/app/api/router.go index 3f7897e..18384e2 100644 --- a/{{cookiecutter.project_name}}/internal/routes/api/router.go +++ b/{{cookiecutter.project_name}}/internal/app/api/router.go @@ -3,11 +3,11 @@ package api import ( "github.com/gofiber/fiber/v2" "github.com/gofiber/fiber/v2/middleware/helmet" - v1 "{{cookiecutter.module_path}}/internal/app/api/v1" + "{{cookiecutter.module_path}}/internal/app/api/v1" ) -func ConfigureRoutes(router *fiber.App) error { - api := router.Group("/api") +func ConfigureRoutes(app *fiber.App) error { + api := app.Group("/api") api.Use(helmet.New()) diff --git a/{{cookiecutter.project_name}}/internal/routes/api/v1/router.go b/{{cookiecutter.project_name}}/internal/app/api/v1/router.go similarity index 100% rename from {{cookiecutter.project_name}}/internal/routes/api/v1/router.go rename to {{cookiecutter.project_name}}/internal/app/api/v1/router.go diff --git a/{{cookiecutter.project_name}}/internal/routes/main.go b/{{cookiecutter.project_name}}/internal/app/main.go similarity index 82% rename from {{cookiecutter.project_name}}/internal/routes/main.go rename to {{cookiecutter.project_name}}/internal/app/main.go index 79b4e9d..4ec4d6e 100644 --- a/{{cookiecutter.project_name}}/internal/routes/main.go +++ b/{{cookiecutter.project_name}}/internal/app/main.go @@ -3,6 +3,7 @@ package app import ( "github.com/gofiber/fiber/v2" "github.com/gofiber/fiber/v2/middleware/compress" + "github.com/gofiber/fiber/v2/middleware/helmet" "github.com/gofiber/fiber/v2/middleware/logger" "{{cookiecutter.module_path}}/internal/app/api" ) @@ -12,6 +13,7 @@ func Run() error { app.Use(logger.New()) app.Use(compress.New()) + app.Use(helmet.New()) api.ConfigureRoutes(app)