diff --git a/core/api.go b/core/api.go index 6c3fc1f..f9e7d95 100644 --- a/core/api.go +++ b/core/api.go @@ -282,19 +282,23 @@ func (caller apiCaller) whitelistAPI(w http.ResponseWriter, r *http.Request) err func (caller apiCaller) serviceAPI(w http.ResponseWriter, r *http.Request) error { mg := caller.mg if r.Method == "GET" { + logger.Println("serviceAPI :", r.URL.Path) if mg.service().Id.IsZero() { + logger.Println(" id is zero") newService := serviceDescription{ ServiceDescriptionSummary: ServiceDescriptionSummary{ Id: primitive.NewObjectID(), }, } if err := newService.prepare(caller.mg); err != nil { + logger.Println(" prepare failed :", err) return err } atomic.StorePointer(&mg.serviceptr, unsafe.Pointer(&newService)) } serptr := atomic.LoadPointer(&mg.service().serviceSerialized) + logger.Println(" loadPointer :", string(*(*[]byte)(serptr))) w.Write(*(*[]byte)(serptr)) } else if r.Method == "POST" { body, _ := io.ReadAll(r.Body)