|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
func setupHTTPHandler() { |
|
|
func setupHTTPHandler() { |
|
|
http.HandleFunc("/api", HelloHandler) |
|
|
|
|
|
//http.HandleFunc("/upload", HelloHandler) |
|
|
|
|
|
//http.HandleFunc("/crmfiles/", HelloHandler) |
|
|
|
|
|
//http.HandleFunc("/dumprequest", HelloHandler) |
|
|
|
|
|
//http.HandleFunc("/MP_verify_6JqVkftKr39GMakA.txt", HelloHandler) |
|
|
|
|
|
//http.HandleFunc("/spa/redirect", HelloHandler) |
|
|
|
|
|
//http.HandleFunc("/iapi/getAccessToken", HelloHandler) |
|
|
|
|
|
//http.HandleFunc("/iapi/createWechatQr", HelloHandler) |
|
|
|
|
|
//http.HandleFunc("/crmpixel.png", HelloHandler) //tracking pixel. |
|
|
|
|
|
//http.HandleFunc("/crmcache", HelloHandler) |
|
|
|
|
|
//http.HandleFunc("/spa/editprofile", HelloHandler) |
|
|
|
|
|
//http.HandleFunc("/spa/livecast", HelloHandler) |
|
|
|
|
|
//http.HandleFunc("/spa/editmeeting", HelloHandler) |
|
|
|
|
|
|
|
|
http.HandleFunc(apiV1Prefix, apiV1Main) |
|
|
|
|
|
http.HandleFunc("/dummy/", dummyHandler) |
|
|
|
|
|
|
|
|
log.Printf("Server started at %s:%s\n", config.Host, config.Port) |
|
|
log.Printf("Server started at %s:%s\n", config.Host, config.Port) |
|
|
log.Fatal(http.ListenAndServe(config.Host+":"+config.Port, nil)) |
|
|
log.Fatal(http.ListenAndServe(config.Host+":"+config.Port, nil)) |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
func HelloHandler(w http.ResponseWriter, r *http.Request) { |
|
|
|
|
|
|
|
|
func dummyHandler(w http.ResponseWriter, r *http.Request) { |
|
|
p := loan.People{} |
|
|
p := loan.People{} |
|
|
p.FakeNew() |
|
|
p.FakeNew() |
|
|
fmt.Fprintf(w, "Hello, there %s, %+v\n", loan.Version, p) |
|
|
fmt.Fprintf(w, "Hello, there %s, %+v\n", loan.Version, p) |