func main() { http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { json.NewEncoder(w).Encode(model.GetData()) }) log.Fatal(http.ListenAndServe(":8080", nil)) }
func main() { k := kite.New("ex", "1.0.0") k.Config.Port = 8081 k.HandleHTTPFunc("/", func(w http.ResponseWriter, r *http.Request) { json.NewEncoder(w).Encode(model.GetData()) }) k.Run() }
func makeEndpoint(svc ExService) endpoint.Endpoint { return func(ctx context.Context, request interface{}) (interface{}, error) { return model.GetData(), nil } }