File tree Expand file tree Collapse file tree 3 files changed +18
-1
lines changed Expand file tree Collapse file tree 3 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file.
44The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.0.0/ ) with the minor change that we use a prefix instead of grouping.
55This project adheres to [ Semantic Versioning] ( https://semver.org/spec/v2.0.0.html ) .
66
7+ ## [ 1.22.0] - 2025-05-15
8+ - Added: unauthenticated health check page
9+
710## [ 1.21.0] - 2025-04-17
811- Added: support added for basic auth
912
Original file line number Diff line number Diff line change @@ -32,11 +32,13 @@ func main() {
3232 if config .server .authUser != "" && config .server .authPW != "" {
3333 r .Handle ("/" , withBasicAuth (landingPage ))
3434 r .Handle ("/metrics" , withBasicAuth (promhttp .Handler ()))
35+ r .Handle ("/probe" , withBasicAuth (probe ))
3536 } else {
3637 r .HandleFunc ("/" , landingPage )
3738 r .Handle ("/metrics" , promhttp .Handler ())
39+ r .HandleFunc ("/probe" , probe )
3840 }
39- r .HandleFunc ("/probe " , probe )
41+ r .HandleFunc ("/health " , health )
4042
4143 err := http .ListenAndServe (
4244 addr ,
Original file line number Diff line number Diff line change 11package main
22
33import (
4+ "encoding/json"
45 "fmt"
56 "net/http"
67)
@@ -43,6 +44,17 @@ func landingPage(w http.ResponseWriter, r *http.Request) {
4344 }
4445}
4546
47+ func health (w http.ResponseWriter , r * http.Request ) {
48+ if r .URL .Path != "/health" {
49+ http .NotFound (w , r )
50+ return
51+ }
52+
53+ w .Header ().Set ("Content-Type" , "application/json" )
54+ json .NewEncoder (w ).Encode (map [string ]string {"status" : "OK" })
55+ return
56+ }
57+
4658func debugProbe (w http.ResponseWriter , probeName string , result runResult ) {
4759 title := "Debug Probe " + probeName
4860
You can’t perform that action at this time.
0 commit comments