package server import ( "log" "net/http" ) func (rest *REST) users(w http.ResponseWriter, r *http.Request) { switch r.Method { case http.MethodPost: default: http.NotFound(w, r) } switch r.URL.Path { case "/register": rest.usersRegister(w, r) case "/login": rest.usersLogin(w, r) default: http.NotFound(w, r) } } func (rest *REST) usersRegister(w http.ResponseWriter, r *http.Request) { log.Println(r.URL.Path, rest.scope(r)) http.Error(w, "not impl", http.StatusNotImplemented) } func (rest *REST) usersLogin(w http.ResponseWriter, r *http.Request) { log.Println(r.URL.Path, rest.scope(r)) http.Error(w, "not impl", http.StatusNotImplemented) }