func CreateUser(w http.ResponseWriter, r *http.Request) { u := &model.User{} json.NewDecoder(r.Body).Decode(u) model.InsertUser(u) w.WriteHeader(201) json.NewEncoder(w).Encode(map[string]interface{}{"id": u.Id()}) }
func post_users(c *golax.Context) { u := &model.User{} json.NewDecoder(c.Request.Body).Decode(u) model.InsertUser(u) c.Response.WriteHeader(201) json.NewEncoder(c.Response).Encode(map[string]interface{}{"id": u.Id()}) }