#109 switch svelte to SSR with go

This commit is contained in:
2024-08-21 23:33:06 +02:00
parent eac373739a
commit f3fb046749
53 changed files with 1796 additions and 6353 deletions

11
utils/http-utils.go Normal file
View File

@@ -0,0 +1,11 @@
package utils
import (
"encoding/json"
"net/http"
)
func WriteJSON(w http.ResponseWriter, data interface{}) error {
w.Header().Set("Content-Type", "application/json")
return json.NewEncoder(w).Encode(data)
}