Compare commits
6 Commits
3f42b1e393
...
b899d44148
Author | SHA1 | Date | |
---|---|---|---|
b899d44148 | |||
![]() |
35dcc8390c | ||
![]() |
7a99b36b00 | ||
![]() |
db88db8b20 | ||
![]() |
cc2875563f | ||
![]() |
4538137ce4 |
6
main.go
6
main.go
@ -53,12 +53,18 @@ 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() {
|
||||
client.Connect()
|
||||
routers.MutexMap = make(map[string]*sync.Mutex)
|
||||
http.HandleFunc("/api/v1/take", handlerWrapper(routers.Take))
|
||||
http.HandleFunc("/api/v1/finish", handlerWrapper(routers.Finish))
|
||||
http.HandleFunc("/api/v1/put", handlerWrapper(routers.Put))
|
||||
http.HandleFunc("/api/v1/metric", metricProxy)
|
||||
log.Printf("Server started")
|
||||
http.ListenAndServe(":1239", nil)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user