initial commit

Signed-off-by: Pin <wf6DJd8a3xSSCZbn@protonmail.com>
This commit is contained in:
Pin
2021-01-31 16:45:18 -05:00
committed by Pin
commit 6121f39c2a
11 changed files with 214 additions and 0 deletions

18
handlers/apihandler.go Normal file
View File

@@ -0,0 +1,18 @@
package handlers
import (
"net/http"
"log"
"dogapi/db"
"encoding/json"
"dogapi/structs"
)
func APIHandler(w http.ResponseWriter, r *http.Request) {
switch r.Method {
case "GET":
var dogquery structs.DogPicRow
dogquery = db.RandomSelect()
json.NewEncoder(w).Encode(dogquery)
}
}