dndex/server/users.go

33 lines
675 B
Go

package server
import (
"log"
"net/http"
)
func (rest *REST) users(w http.ResponseWriter, r *http.Request) {
switch r.Method {
case http.MethodPost:
default:
rest.respNotFound(w)
}
switch r.URL.Path {
case "/register":
rest.usersRegister(w, r)
case "/login":
rest.usersLogin(w, r)
default:
rest.respNotFound(w)
}
}
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)
}