Skip to content

Commit

Permalink
print hostname
Browse files Browse the repository at this point in the history
  • Loading branch information
jakeyheath committed Jan 18, 2024
1 parent 0ba6a42 commit 0437f48
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions examples/typical_app/src/api/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"net/http"
"os"
"strconv"
"strings"
"time"

"github.com/gofiber/fiber/v2"
Expand All @@ -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})
})

Expand Down

0 comments on commit 0437f48

Please sign in to comment.