Archived
2
0

add HEALTHCHECK.

This commit is contained in:
m1k1o
2021-03-19 14:42:54 +01:00
parent 14939db65a
commit ed2cdaf71d
3 changed files with 8 additions and 0 deletions

View File

@ -34,6 +34,10 @@ func New(conf *config.Server, webSocketHandler types.WebSocketHandler) *Server {
webSocketHandler.Upgrade(w, r)
})
router.Get("/health", func(w http.ResponseWriter, r *http.Request) {
w.Write([]byte("true"))
})
fs := http.FileServer(http.Dir(conf.Static))
router.Get("/*", func(w http.ResponseWriter, r *http.Request) {
if _, err := os.Stat(conf.Static + r.URL.Path); !os.IsNotExist(err) {