diff --git a/main.go b/main.go index 20c6304..9188e07 100644 --- a/main.go +++ b/main.go @@ -12,13 +12,16 @@ import ( //PathsConfig all system available pathes type PathsConfig struct { - Angular2App string `json:"angular2_app"` + Angular2App string `json:"angular2_app"` + SinglePageEdit string `json:"singlePageEdit"` } -//TODO: setup GlobalPath Config, from reading file //GlobalPath all global pathes configurations +// TODO: setup GlobalPath Config, from reading file var GlobalPath = PathsConfig{ - "/mnt/data/workspace/angular.ts/wechat/ng2-admin/dist/"} + "dist/", + "/mnt/data/workspace/go/src/wechat_hitxy/spa/", +} //KFUsers info cache about current customer service var KFUsers kfCache @@ -65,6 +68,7 @@ func setupHTTPHandler() { http.HandleFunc("/iapi/createWechatQr", iapiCreateWechatQrCode) http.HandleFunc("/crmpixel.png", crmpixel) //tracking pixel. http.HandleFunc("/crmcache", crmcache) + http.HandleFunc("/spa/editprofile", spaEditProfile) http.ListenAndServe(":65500", nil) } @@ -79,8 +83,8 @@ func setupRootFileServer() { http.ServeFile(w, r, GlobalPath.Angular2App+r.URL.Path[1:]) }) - //fs := http.FileServer(http.Dir("/mnt/data/workspace/angular.ts/ng2-admin/dist")) - //http.Handle("/test", http.StripPrefix("/test", fs)) + fs := http.FileServer(http.Dir(GlobalPath.SinglePageEdit)) + http.Handle("/spa/", http.StripPrefix("/spa", fs)) //fs := http.FileServer(http.Dir("/mnt/data/workspace/angular.ts/wechat/ng2-admin/dist")) //http.Handle("/", fs)