From 1d2ffb8a2b6af752b6fd091e8e59682625c2b495 Mon Sep 17 00:00:00 2001 From: Michael Hunteman Date: Wed, 28 Aug 2024 18:07:22 -0700 Subject: Make guests endpoint plural --- server/guest/handler.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'server/guest') 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) -- cgit v1.2.3