Browse Source

controllers: Refactored UserController.MOunt to use HandleFunc.

login_bugfix
Gisle Aune 5 years ago
parent
commit
659f95346d
  1. 4
      controllers/user-controller.go

4
controllers/user-controller.go

@ -60,8 +60,8 @@ func (c *UserController) login(w http.ResponseWriter, r *http.Request) {
func (c *UserController) Mount(router *mux.Router, prefix string) {
sub := router.PathPrefix(prefix).Subrouter()
sub.Handle("/", http.HandlerFunc(c.getUsers)).Methods("GET")
sub.Handle("/login", http.HandlerFunc(c.login)).Methods("POST")
sub.HandleFunc("/", c.getUsers).Methods("GET")
sub.HandleFunc("/login", c.login).Methods("POST")
}
// NewUserController creates a new UserController.

Loading…
Cancel
Save