diff --git a/controller/home.go b/controller/home.go index 4f4a5a3..5bea362 100644 --- a/controller/home.go +++ b/controller/home.go @@ -1,6 +1,7 @@ package controller import ( + "fmt" "net/http" "github.com/bonfy/go-mega-code/vm" @@ -24,5 +25,13 @@ func loginHandler(w http.ResponseWriter, r *http.Request) { tpName := "login.html" vop := vm.LoginViewModelOp{} v := vop.GetVM() - templates[tpName].Execute(w, &v) + if r.Method == http.MethodGet { + templates[tpName].Execute(w, &v) + } + if r.Method == http.MethodPost { + r.ParseForm() + username := r.Form.Get("username") + password := r.Form.Get("password") + fmt.Fprintf(w, "Username:%s Password:%s", username, password) + } }