mirror of https://github.com/shunfei/cronsun
web: 提示版本号不一致的 node
parent
bc442fb8ba
commit
ecdb29fe02
|
@ -7,8 +7,13 @@ import (
|
|||
"github.com/gorilla/mux"
|
||||
|
||||
"sunteng/cronsun/conf"
|
||||
"sunteng/cronsun/models"
|
||||
)
|
||||
|
||||
func GetVersion(w http.ResponseWriter, r *http.Request) {
|
||||
outJSON(w, models.Version)
|
||||
}
|
||||
|
||||
func InitRouters() (s *http.Server, err error) {
|
||||
jobHandler := &Job{}
|
||||
nodeHandler := &Node{}
|
||||
|
@ -18,6 +23,7 @@ func InitRouters() (s *http.Server, err error) {
|
|||
|
||||
r := mux.NewRouter()
|
||||
subrouter := r.PathPrefix("/v1").Subrouter()
|
||||
subrouter.Handle("/version", BaseHandler{Handle: GetVersion}).Methods("GET")
|
||||
|
||||
// get job list
|
||||
h := BaseHandler{Handle: jobHandler.GetList}
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue