2013-12-03 04:56:55 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"github.com/gorilla/mux"
|
|
|
|
"net/http"
|
|
|
|
)
|
|
|
|
|
|
|
|
func API(w http.ResponseWriter, r *http.Request) {
|
|
|
|
fmt.Fprintf(w, "Hello api")
|
|
|
|
}
|
|
|
|
|
|
|
|
func API_Campaigns(w http.ResponseWriter, r *http.Request) {
|
|
|
|
fmt.Fprintf(w, "Hello api")
|
|
|
|
}
|
|
|
|
|
2013-12-07 21:08:09 +00:00
|
|
|
func API_Campaigns_Id(w http.ResponseWriter, r *http.Request) {
|
2013-12-03 04:56:55 +00:00
|
|
|
w.Header().Set("Content-Type", "application/json")
|
|
|
|
vars := mux.Vars(r)
|
2013-12-07 21:08:09 +00:00
|
|
|
fmt.Fprintf(w, "{\"method\" : \""+r.Method+"\", \"id\" : "+vars["id"]+"}")
|
2013-12-03 04:56:55 +00:00
|
|
|
}
|