Skip to content

Commit

Permalink
chore: delete http endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
senk8 committed Jan 22, 2024
1 parent adc99d9 commit 3d84470
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions pkg/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"fmt"
"net"
"net/http"
"os"
"os/signal"
"syscall"
Expand Down Expand Up @@ -130,23 +129,6 @@ func (s *Server) Run(ctx context.Context) error {
}
}()

mux := http.NewServeMux()
mux.HandleFunc("/healthz", func(w http.ResponseWriter, r *http.Request) {
if err := healthCheck(ctx, clientAddr); err != nil {
w.WriteHeader(http.StatusServiceUnavailable)
s.logger.Errorf(ctx, "health check is failed: %w", err)
} else {
fmt.Fprintln(w, "ok")
}
})

go func() {
if err := http.ListenAndServe(fmt.Sprintf("%s:3000", s.host), mux); err != http.ErrServerClosed {
s.logger.Errorf(ctx, "failed to start http server: %w", err)
errChan <- err
}
}()

ctx, stop := signal.NotifyContext(ctx, os.Interrupt, syscall.SIGTERM)
defer stop()

Expand Down

0 comments on commit 3d84470

Please sign in to comment.