Signed-off-by: Pin <wf6DJd8a3xSSCZbn@protonmail.com>
This commit is contained in:
Pin
2021-01-31 16:51:31 -05:00
parent ab66454020
commit 3d125fe8a2

View File

@@ -8,26 +8,11 @@ import (
"dogapi/structs"
)
type Dog struct {
Id string `json:"id"`
Author string `json:"author"`
Title string `json:"title"`
Format string `json:"format"`
Hash string `json:"hash"`
Breed string `json:"breed"`
Url string `json:"url"`
}
func APIHandler(w http.ResponseWriter, r *http.Request) {
switch r.Method {
case "GET":
var dogquery structs.DogPicRow
dogquery = db.RandomSelect()
log.Println(dogquery)
var res Dog
res.Id = "1"
res.Author = "spencer"
res.Title = "cool dog"
json.NewEncoder(w).Encode(dogquery)
}
}