This commit is contained in:
2025-05-11 11:54:21 +02:00
parent 4144e694c0
commit 827cb66b4e
13 changed files with 234 additions and 257 deletions
+12
View File
@@ -0,0 +1,12 @@
package network
import (
"encoding/json"
"net/http"
)
func JSON(w http.ResponseWriter, code int, v any) {
w.Header().Set("Content-Type", "application/json")
w.WriteHeader(code)
json.NewEncoder(w).Encode(v)
}