Skip to content

Commit

Permalink
feat: add ping handler
Browse files Browse the repository at this point in the history
  • Loading branch information
gazenw committed Apr 24, 2024
1 parent 6e0c8e8 commit 967bfda
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/cmd_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"fmt"
"log/slog"
"net/http"
"os"
"os/signal"
"runtime"
Expand Down Expand Up @@ -265,6 +266,10 @@ func runHandler(opts *runCmdOptions, cmd *cobra.Command, _ []string) error {
Use(compress.New(compress.Config{
Level: compress.LevelDefault,
}))
// ping handler
app.Get("/", func(c *fiber.Ctx) error {
return errors.WithStack(c.SendStatus(http.StatusOK))
})

// mount http handlers from each http-enabled module
for module, handler := range httpHandlers {
Expand Down

0 comments on commit 967bfda

Please sign in to comment.