Skip to content

Commit

Permalink
feat: health improvement (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
garrettladley authored Sep 30, 2024
1 parent 58aa709 commit a4fd7d7
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions backend/internal/handlers/health/health.go
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
package health

import (
"github.com/GenerateNU/nightlife/internal/types"
"github.com/gofiber/fiber/v2"
"net/http"
"runtime"

"github.com/GenerateNU/nightlife/internal/types"
"github.com/gofiber/fiber/v2"
)

func (s *Service) GetHealth(c *fiber.Ctx) error {
sysInfo := &types.SysInfo{
OS: runtime.GOOS,
Architecture: runtime.GOARCH,
CPUCores: runtime.NumCPU(),
GoVersion: runtime.Version(),
}
var health = &types.SysInfo{
OS: runtime.GOOS,
Architecture: runtime.GOARCH,
CPUCores: runtime.NumCPU(),
GoVersion: runtime.Version(),
}

return c.Status(http.StatusOK).JSON(fiber.Map{
"status": "ok",
"system": sysInfo,
})
func (s *Service) GetHealth(c *fiber.Ctx) error {
return c.
Status(http.StatusOK).
JSON(
fiber.Map{
"status": "ok",
"system": health,
},
)
}

0 comments on commit a4fd7d7

Please sign in to comment.