Skip to content

Commit

Permalink
feat(handlers.go): replace hardcoded API version with environment var…
Browse files Browse the repository at this point in the history
…iable to allow dynamic versioning based on deployment configuration
  • Loading branch information
Abdullah Alqahtani committed Dec 29, 2024
1 parent db59460 commit ed8107c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/handlers/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func (h *Handler) ApiV1Handler(c *fiber.Ctx) error {
return c.JSON(fiber.Map{
"status": "active",
"message": "Welcome to NAQA API v1",
"version": "1.0.0",
"version": os.Getenv("API_VERSION"),
"env": os.Getenv("ENVIRONMENT"),
"server_time": time.Now().Format(time.RFC3339),
"request_id": c.Get("X-Request-ID", uuid.New().String()),
Expand Down

0 comments on commit ed8107c

Please sign in to comment.