diff options
author | Steve Manuel <nilslice@gmail.com> | 2016-11-01 21:36:25 -0700 |
---|---|---|
committer | Steve Manuel <nilslice@gmail.com> | 2016-11-01 21:36:25 -0700 |
commit | 6ee469616d56b069dd68391577f0cd9411abc46a (patch) | |
tree | 2ea2da04b0726706bd5b0aa81891b02f7fa1ac32 /system/api/server.go | |
parent | ac647e2f77d05cc015a369832c2d428ec1cd6567 (diff) |
adding analytics tracking to API calls
Diffstat (limited to 'system/api/server.go')
-rw-r--r-- | system/api/server.go | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/system/api/server.go b/system/api/server.go index 816bc21..bfd8469 100644 --- a/system/api/server.go +++ b/system/api/server.go @@ -1,14 +1,18 @@ package api -import "net/http" +import ( + "net/http" + + a "github.com/bosssauce/ponzu/system/api/analytics" +) // Run adds Handlers to default http listener for API func Run() { - http.HandleFunc("/api/types", CORS(typesHandler)) + http.HandleFunc("/api/types", CORS(a.Record(typesHandler))) - http.HandleFunc("/api/posts", CORS(postsHandler)) + http.HandleFunc("/api/posts", CORS(a.Record(postsHandler))) - http.HandleFunc("/api/post", CORS(postHandler)) + http.HandleFunc("/api/post", CORS(a.Record(postHandler))) - http.HandleFunc("/api/external/posts", CORS(externalPostsHandler)) + http.HandleFunc("/api/external/posts", CORS(a.Record(externalPostsHandler))) } |