1
0
mirror of https://github.com/mgerb/mywebsite synced 2026-01-12 02:42:48 +00:00

getting close to finishing temperature data api

This commit is contained in:
2016-05-17 23:26:15 -05:00
parent 6627cb4cd6
commit b6d5854250
16 changed files with 693 additions and 86 deletions

29
testing_files/testApi.go Normal file
View File

@@ -0,0 +1,29 @@
package test
import (
"encoding/json"
"fmt"
"github.com/julienschmidt/httprouter"
"net/http"
)
type ApiCall struct {
Fname string
Lname string
}
// Redirect to discord
func TestApiCall(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
s := new(ApiCall)
s.Fname = ps.ByName("fname")
s.Lname = ps.ByName("lname")
response, _ := json.MarshalIndent(s, "", " ")
w.Header().Set("Content-Type", "application/json")
fmt.Fprint(w, string(response))
}