diff options
author | Michael Hunteman <michael@huntm.net> | 2024-08-28 18:07:22 -0700 |
---|---|---|
committer | Michael Hunteman <michael@huntm.net> | 2024-08-28 18:07:22 -0700 |
commit | 1d2ffb8a2b6af752b6fd091e8e59682625c2b495 (patch) | |
tree | 97ddc1a0318d280cd6650f59d638e027d213263e /server/guest | |
parent | 096a08708e2310becba56a237ef63b5cf6e3c4c4 (diff) |
Make guests endpoint plural
Diffstat (limited to 'server/guest')
-rw-r--r-- | server/guest/handler.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/server/guest/handler.go b/server/guest/handler.go index 153a633..418c223 100644 --- a/server/guest/handler.go +++ b/server/guest/handler.go @@ -12,8 +12,8 @@ import ( ) var ( - guestRegex = regexp.MustCompile(`^/guest/*$`) - guestIDRegex = regexp.MustCompile(`^/guest/([0-9]+)$`) + guestRegex = regexp.MustCompile(`^/guests/*$`) + guestIDRegex = regexp.MustCompile(`^/guests/([0-9]+)$`) ) type GuestHandler struct { @@ -43,7 +43,7 @@ func (guestHandler *GuestHandler) ServeHTTP(responseWriter http.ResponseWriter, switch { case request.Method == http.MethodOptions: responseWriter.WriteHeader(http.StatusOK) - case request.Method == http.MethodPost && request.URL.Path == "/guest/login": + case request.Method == http.MethodPost && request.URL.Path == "/guests/login": guestHandler.handleLogIn(responseWriter, request) case request.Method == http.MethodPut && guestIDRegex.MatchString(request.URL.Path): guestHandler.handlePut(responseWriter, request) |