Skip to content

Commit fa6cd0b

Browse files
committed
Add health check route
1 parent 8104239 commit fa6cd0b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

apisprout.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,12 @@ func server(cmd *cobra.Command, args []string) {
438438
})
439439
}
440440

441+
// Add a health check route which returns 200
442+
http.HandleFunc("/__health", func(w http.ResponseWriter, r *http.Request) {
443+
w.WriteHeader(200)
444+
log.Printf("Health check")
445+
})
446+
441447
// Register our custom HTTP handler that will use the router to find
442448
// the appropriate OpenAPI operation and try to return an example.
443449
http.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) {

0 commit comments

Comments
 (0)