Skip to content

Commit

Permalink
refactor: exclude healthcheck from access logs
Browse files Browse the repository at this point in the history
  • Loading branch information
cshum committed Mar 7, 2024
1 parent bb1ed45 commit d8a58fe
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,16 @@ func New(app Service, options ...Option) *Server {
// Handler: application
s.Handler = s.App

for _, option := range options {
option(s)
}

// Handler: utility routes
s.Handler = pathHandler(http.MethodGet, map[string]http.HandlerFunc{
"/favicon.ico": handleOk,
"/healthcheck": handleOk,
})(s.Handler)

for _, option := range options {
option(s)
}

// Handler: prefixes
if s.PathPrefix != "" {
s.Handler = http.StripPrefix(s.PathPrefix, s.Handler)
Expand Down

0 comments on commit d8a58fe

Please sign in to comment.