Compare commits

..

No commits in common. "b899d44148a9eeab4c528826a85b873e17bc8750" and "3f42b1e393abf611df49bd8e8007418bdcff852a" have entirely different histories.

View File

@ -53,18 +53,12 @@ func handlerWrapper(f func(*http.Request) (interface{}, int)) func(http.Response
} }
} }
func metricProxy(w http.ResponseWriter, r *http.Request) {
http.Post("http://monitoring:1237/api/v1/metrics/task", "application/json", r.Body)
w.WriteHeader(202)
}
func main() { func main() {
client.Connect() client.Connect()
routers.MutexMap = make(map[string]*sync.Mutex) routers.MutexMap = make(map[string]*sync.Mutex)
http.HandleFunc("/api/v1/take", handlerWrapper(routers.Take)) http.HandleFunc("/api/v1/take", handlerWrapper(routers.Take))
http.HandleFunc("/api/v1/finish", handlerWrapper(routers.Finish)) http.HandleFunc("/api/v1/finish", handlerWrapper(routers.Finish))
http.HandleFunc("/api/v1/put", handlerWrapper(routers.Put)) http.HandleFunc("/api/v1/put", handlerWrapper(routers.Put))
http.HandleFunc("/api/v1/metric", metricProxy)
log.Printf("Server started") log.Printf("Server started")
http.ListenAndServe(":1239", nil) http.ListenAndServe(":1239", nil)
} }