From 6ee469616d56b069dd68391577f0cd9411abc46a Mon Sep 17 00:00:00 2001 From: Steve Manuel Date: Tue, 1 Nov 2016 21:36:25 -0700 Subject: adding analytics tracking to API calls --- system/api/server.go | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'system/api/server.go') 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))) } -- cgit v1.2.3 From 0f07efbf6ad59793c96fb1d7ffdd68ddff7bd7f4 Mon Sep 17 00:00:00 2001 From: Steve Manuel Date: Tue, 1 Nov 2016 21:39:42 -0700 Subject: adding analytics tracking to API calls --- system/api/server.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'system/api/server.go') diff --git a/system/api/server.go b/system/api/server.go index bfd8469..4468394 100644 --- a/system/api/server.go +++ b/system/api/server.go @@ -2,17 +2,15 @@ package api 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(a.Record(typesHandler))) + http.HandleFunc("/api/types", CORS(Record(typesHandler))) - http.HandleFunc("/api/posts", CORS(a.Record(postsHandler))) + http.HandleFunc("/api/posts", CORS(Record(postsHandler))) - http.HandleFunc("/api/post", CORS(a.Record(postHandler))) + http.HandleFunc("/api/post", CORS(Record(postHandler))) - http.HandleFunc("/api/external/posts", CORS(a.Record(externalPostsHandler))) + http.HandleFunc("/api/external/posts", CORS(Record(externalPostsHandler))) } -- cgit v1.2.3