mirror of
https://github.com/github-tijlxyz/khatru-pyramid.git
synced 2025-04-19 18:31:18 +00:00
21 lines
544 B
Go
21 lines
544 B
Go
package main
|
|
|
|
import (
|
|
"encoding/json"
|
|
"net/http"
|
|
)
|
|
|
|
func inviteDataApiHandler(w http.ResponseWriter, re *http.Request) {
|
|
jsonBytes, err := json.Marshal(whitelist)
|
|
if err != nil {
|
|
http.Error(w, "internal server error", http.StatusInternalServerError)
|
|
return
|
|
}
|
|
w.Header().Set("Content-Type", "application/json")
|
|
w.Header().Set("Access-Control-Allow-Origin", "*")
|
|
w.WriteHeader(http.StatusOK)
|
|
if _, err := w.Write(jsonBytes); err != nil {
|
|
http.Error(w, "internal server error", http.StatusInternalServerError)
|
|
}
|
|
}
|