RestApiv2/internal/restserver/userHendle.go

28 lines
554 B
Go
Raw Normal View History

package restserver
import (
"fmt"
"net/http"
)
func (r *RestServer) configureRouterUser() {
r.router.HandleFunc("/api/register", r.HandleFuncRegUser()).Methods("POST")
}
func (r *RestServer) HandleFuncRegUser() http.HandlerFunc {
return func(w http.ResponseWriter, res *http.Request) {
err := res.ParseForm()
if err != nil {
r.logger.Error(err)
}
user := res.Form.Get("user")
password := res.Form.Get("password")
mail := res.Form.Get("email")
borndata := res.Form.Get("born")
fmt.Println(user, password, mail, borndata)
}
}