28 lines
554 B
Go
28 lines
554 B
Go
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)
|
|
}
|
|
|
|
}
|