mirror of
https://github.com/skidoodle/ipinfo.git
synced 2025-02-15 08:29:17 +01:00
Add health check endpoint
This commit is contained in:
parent
58c3b13d04
commit
ef0978447f
2 changed files with 12 additions and 0 deletions
11
health.go
Normal file
11
health.go
Normal file
|
@ -0,0 +1,11 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func healthCheck() {
|
||||
http.HandleFunc("/health", func(w http.ResponseWriter, r *http.Request) {
|
||||
w.Write([]byte("Healthy"))
|
||||
})
|
||||
}
|
1
main.go
1
main.go
|
@ -3,5 +3,6 @@ package main
|
|||
func main() {
|
||||
initDatabases()
|
||||
go startUpdater()
|
||||
healthCheck()
|
||||
startServer()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue