From f12ac2f4d896ae65e3b17ddbc21a58664535d794 Mon Sep 17 00:00:00 2001 From: bjdgyc Date: Fri, 18 Nov 2022 15:17:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=81=A5=E5=BA=B7=E6=A3=80?= =?UTF-8?q?=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/handler/server.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server/handler/server.go b/server/handler/server.go index 6cfd4cc..70f8fb6 100644 --- a/server/handler/server.go +++ b/server/handler/server.go @@ -3,6 +3,7 @@ package handler import ( "crypto/tls" "fmt" + "io" "log" "net" "net/http" @@ -88,6 +89,10 @@ func initRoute() http.Handler { http.FileServer(http.Dir(base.Cfg.FilesPath)), ), ) + // 健康检测 + r.HandleFunc("/status", func(w http.ResponseWriter, r *http.Request) { + io.WriteString(w, "ok") + }).Methods(http.MethodGet) r.NotFoundHandler = http.HandlerFunc(notFound) return r }