From 6cf9ae4bb870b305aa274addf7686c4b8370ada2 Mon Sep 17 00:00:00 2001 From: Jordan Date: Thu, 9 Jan 2014 00:43:08 -0600 Subject: [PATCH] Moved api.go to controllers - This commit shows the old one was deleted. --- api.go | 37 ------------------------------------- 1 file changed, 37 deletions(-) delete mode 100644 api.go diff --git a/api.go b/api.go deleted file mode 100644 index 4c27681d..00000000 --- a/api.go +++ /dev/null @@ -1,37 +0,0 @@ -package main - -import ( - "fmt" - "net/http" - - "github.com/gorilla/mux" -) - -func API(w http.ResponseWriter, r *http.Request) { - fmt.Fprintf(w, "Hello api") -} - -//API_Campaigns returns a list of campaigns if requested via GET. -//If requested via POST, API_Campaigns creates a new campaign and returns a reference to it. -func API_Campaigns(w http.ResponseWriter, r *http.Request) { - switch { - case r.Method == "GET": - - case r.Method == "POST": - fmt.Fprintf(w, "Hello POST!") - } - fmt.Fprintf(w, "Hello api") -} - -//API_Campaigns_Id returns details about the requested campaign. If the campaign is not -//valid, API_Campaigns_Id returns null. -func API_Campaigns_Id(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "application/json") - vars := mux.Vars(r) - fmt.Fprintf(w, "{\"method\" : \""+r.Method+"\", \"id\" : "+vars["id"]+"}") -} - -//API_Doc renders a template describing the API documentation. -func API_Doc(w http.ResponseWriter, r *http.Request) { - renderTemplate(w, "api_doc") -}