etheryo/backend/server/pictures.go

16 lines
383 B
Go

package server
import (
"backend/core"
"backend/util"
"net/http"
)
func getphoto(w http.ResponseWriter, r *http.Request) {
if r.Method != "GET" {
util.Logformat(util.ERROR, "%s: Only GET is accepted (%s received)", util.GetFunctionName(), r.Method)
http.Error(w, "Only GET method is accepted", http.StatusBadRequest)
} else {
sendResponse(w, core.GetPictureData())
}
}