mirror of
				https://github.com/bjdgyc/anylink.git
				synced 2025-11-04 19:16:22 +08:00 
			
		
		
		
	添加健康检测
This commit is contained in:
		@@ -3,6 +3,7 @@ package handler
 | 
				
			|||||||
import (
 | 
					import (
 | 
				
			||||||
	"crypto/tls"
 | 
						"crypto/tls"
 | 
				
			||||||
	"fmt"
 | 
						"fmt"
 | 
				
			||||||
 | 
						"io"
 | 
				
			||||||
	"log"
 | 
						"log"
 | 
				
			||||||
	"net"
 | 
						"net"
 | 
				
			||||||
	"net/http"
 | 
						"net/http"
 | 
				
			||||||
@@ -88,6 +89,10 @@ func initRoute() http.Handler {
 | 
				
			|||||||
			http.FileServer(http.Dir(base.Cfg.FilesPath)),
 | 
								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)
 | 
						r.NotFoundHandler = http.HandlerFunc(notFound)
 | 
				
			||||||
	return r
 | 
						return r
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user