Skip to content

Commit

Permalink
Write status code explicitly
Browse files Browse the repository at this point in the history
  • Loading branch information
arunvelsriram committed Aug 11, 2020
1 parent 965f0dd commit 9655dfe
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ package server

import (
"fmt"
"net/http"

"github.com/arunvelsriram/sftp-exporter/pkg/client"
"github.com/arunvelsriram/sftp-exporter/pkg/collector"
"github.com/arunvelsriram/sftp-exporter/pkg/config"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
log "github.com/sirupsen/logrus"
"net/http"
)

func Start(cfg config.Config) error {
Expand All @@ -27,6 +28,7 @@ func Start(cfg config.Config) error {

func healthzHandler() http.Handler {
fn := func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusOK)
_, _ = fmt.Fprintf(w, "healthy")
}
return http.HandlerFunc(fn)
Expand Down

0 comments on commit 9655dfe

Please sign in to comment.