浏览代码

Added healthcheck

Ronald Peterson 10 年之前
父节点
当前提交
6816e2d050
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      battlecamp-go-boardgenerator/main.go

+ 5 - 0
battlecamp-go-boardgenerator/main.go

@@ -9,6 +9,7 @@ import (
 
 func main() {
 	http.HandleFunc("/", generateBoard)
+	http.HandleFunc("/status", status)
 	log.Fatal(http.ListenAndServe(":8081", nil))
 }
 
@@ -23,3 +24,7 @@ func generateBoard(w http.ResponseWriter, r *http.Request) {
 	b := board.NewPartial(x, y, width, height, totalWidth, totalHeight)
 	b.WriteData(w)
 }
+
+func status(w http.ResponseWriter, r *http.Request) {
+	w.Write([]byte("ok"))
+}