add bb_api rest api for begushiybashkir

This commit is contained in:
2025-10-07 05:23:40 +05:00
parent de0c992db9
commit 23d68e53ab
16 changed files with 552 additions and 1 deletions
@@ -0,0 +1,16 @@
package handlers
import (
"encoding/json"
"net/http"
)
func respondWithJSON(w http.ResponseWriter, status int, payload interface{}) {
w.Header().Set("Content-Type", "application/json")
w.WriteHeader(status)
json.NewEncoder(w).Encode(payload)
}
func respondWithError(w http.ResponseWriter, status int, message string) {
respondWithJSON(w, status, map[string]string{"error": message})
}