This commit is contained in:
cdricms
2025-01-15 11:54:39 +01:00
parent d18245736f
commit 683a8c3133
13 changed files with 165 additions and 69 deletions

View File

@@ -43,6 +43,7 @@ func handlerCreateUser(w http.ResponseWriter, r *http.Request) {
LastName: "Doe",
Email: "john.doe@example.com",
Phone: "1234567890",
Password: "1234",
}
_, err := DB.NewInsert().Model(user).Exec(context.Background())
@@ -79,6 +80,7 @@ func main() {
http.HandleFunc("/", handler)
http.HandleFunc("/user/new", handlerCreateUser)
http.HandleFunc("/users/login", HandleLogin)
fmt.Printf("Serving on port %s\n", port)
err = http.ListenAndServe(fmt.Sprintf(":%s", port), nil)