From 0437f481f61138f3e6644800d50c886b50b6415f Mon Sep 17 00:00:00 2001 From: Jake Heath Date: Thu, 18 Jan 2024 13:27:02 -0800 Subject: [PATCH] print hostname --- examples/typical_app/src/api/main.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/examples/typical_app/src/api/main.go b/examples/typical_app/src/api/main.go index 303b24fd47..17ebfe4f3a 100644 --- a/examples/typical_app/src/api/main.go +++ b/examples/typical_app/src/api/main.go @@ -6,7 +6,6 @@ import ( "net/http" "os" "strconv" - "strings" "time" "github.com/gofiber/fiber/v2" @@ -32,12 +31,12 @@ func main() { })) app.Get("/", func(c *fiber.Ctx) error { - env := strings.Join(os.Environ(), "\n") + env, _ := os.LookupEnv("HOSTNAME") return c.Status(http.StatusOK).JSON(Response{Status: "OK", Service: "frontend", Env: env}) }) app.Get("/health", func(c *fiber.Ctx) error { - env := strings.Join(os.Environ(), "\n") + env, _ := os.LookupEnv("HOSTNAME") return c.Status(http.StatusOK).JSON(Response{Status: "Health", Service: "frontend", Env: env}) })