mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-12 19:14:23 +00:00
8830896199
* feat: separate setup from startup * health * move setup config * add env vars to caos_local.sh * fix domain and set devMode explicit
20 lines
404 B
Go
20 lines
404 B
Go
package http
|
|
|
|
import (
|
|
"encoding/json"
|
|
"net/http"
|
|
|
|
"github.com/caos/logging"
|
|
)
|
|
|
|
func MarshalJSON(w http.ResponseWriter, i interface{}) {
|
|
b, err := json.Marshal(i)
|
|
if err != nil {
|
|
http.Error(w, err.Error(), http.StatusInternalServerError)
|
|
return
|
|
}
|
|
w.Header().Set("content-type", "application/json")
|
|
_, err = w.Write(b)
|
|
logging.Log("HTTP-sdgT2").OnError(err).Error("error writing response")
|
|
}
|