| package main | package main | ||||
| import ( | import ( | ||||
| "fmt" | |||||
| "log" | "log" | ||||
| "net/http" | "net/http" | ||||
| "net/http/httputil" | |||||
| ) | ) | ||||
| //PathsConfig all system available pathes | //PathsConfig all system available pathes | ||||
| http.HandleFunc("/api", apiV1Main) | http.HandleFunc("/api", apiV1Main) | ||||
| http.HandleFunc("/upload", uploadHandler) | http.HandleFunc("/upload", uploadHandler) | ||||
| http.HandleFunc("/crmfiles/", crmAttachmentHandler) | http.HandleFunc("/crmfiles/", crmAttachmentHandler) | ||||
| http.HandleFunc("/dumprequest", dumpReuestHandler) | |||||
| http.ListenAndServe(":65500", nil) | http.ListenAndServe(":65500", nil) | ||||
| } | } | ||||
| //fs := http.FileServer(http.Dir("/mnt/data/workspace/angular.ts/wechat/ng2-admin/dist")) | //fs := http.FileServer(http.Dir("/mnt/data/workspace/angular.ts/wechat/ng2-admin/dist")) | ||||
| //http.Handle("/", fs) | //http.Handle("/", fs) | ||||
| } | } | ||||
| func dumpReuestHandler(w http.ResponseWriter, r *http.Request) { | |||||
| logRequestDebug(httputil.DumpRequest(r, true)) | |||||
| fmt.Fprintf(w, "") | |||||
| } |