git-svn-id: svn://47.119.165.148/zhub@161 e63fbceb-bcc3-4977-ac22-735b83d8d0f4
This commit is contained in:
lxy
2023-03-07 06:34:28 +00:00
parent 6a3d23ee8d
commit 71565c9a6c
4 changed files with 11 additions and 8 deletions

View File

@@ -2,6 +2,7 @@ package zsub
import (
"encoding/json"
"log"
"net/http"
"os"
"path"
@@ -12,7 +13,7 @@ func init() {
}
func StartHttp() {
func StartWatch() {
dir, _ := os.Getwd()
webDir := path.Join(dir, "/public")
@@ -22,7 +23,9 @@ func StartHttp() {
http.HandleFunc("/retimer", retimer)
http.HandleFunc("/topic/publish", publish)
http.ListenAndServe(":1217", nil)
watchAddr := GetStr("service.zhub.watch", "0.0.0.0:1217")
log.Println("zhub.watch = ", watchAddr)
http.ListenAndServe(watchAddr, nil)
}
func publish(w http.ResponseWriter, r *http.Request) {