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)