-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmain.go
More file actions
28 lines (24 loc) · 568 Bytes
/
main.go
File metadata and controls
28 lines (24 loc) · 568 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package main
import (
"log"
"net/http"
)
var (
Revision = ""
Branch = ""
BuildDate = ""
)
func main() {
log.Printf("Starting application. branch=%s revision=%s builddate=%s",
Branch, Revision, BuildDate)
a, err := initApp()
if err != nil {
log.Fatalf("invalid configuration: %s\n", err.Error())
}
http.HandleFunc("/cleanup", a.RequestHandler())
http.HandleFunc("/present", a.RequestHandler())
http.HandleFunc("/healthz", func(w http.ResponseWriter, r *http.Request) {
w.Write([]byte("OK"))
})
log.Fatal(http.ListenAndServe(":8080", nil))
}