1
0
mirror of https://github.com/coalaura/whiskr.git synced 2025-09-09 09:19:54 +00:00

initial commit

This commit is contained in:
Laura
2025-08-05 03:56:23 +02:00
commit 4b40053ce9
27 changed files with 1287 additions and 0 deletions

13
http.go Normal file
View File

@@ -0,0 +1,13 @@
package main
import (
"encoding/json"
"net/http"
)
func RespondJson(w http.ResponseWriter, code int, data any) {
w.Header().Set("Content-Type", "application/json")
w.WriteHeader(code)
json.NewEncoder(w).Encode(data)
}