From 187d10ca4ad7fc0e624c537452de714a31eceb4e Mon Sep 17 00:00:00 2001 From: max Date: Tue, 1 Nov 2022 11:23:44 -0500 Subject: [PATCH] Routes and show controller functions for login and logout --- controllers/getController.go | 8 ++++++++ routes/getRoutes.go | 2 ++ 2 files changed, 10 insertions(+) diff --git a/controllers/getController.go b/controllers/getController.go index 5a2aeed..5706d44 100644 --- a/controllers/getController.go +++ b/controllers/getController.go @@ -26,3 +26,11 @@ func (getController *GetController) ShowHome(w http.ResponseWriter, r *http.Requ func (getController *GetController) ShowRegister(w http.ResponseWriter, r *http.Request) { templating.RenderTemplate(getController.App, w, "templates/pages/register.html", nil) } + +func (getController *GetController) ShowLogin(w http.ResponseWriter, r *http.Request) { + templating.RenderTemplate(getController.App, w, "templates/pages/login.html", nil) +} + +func (getController *GetController) Logout(w http.ResponseWriter, r *http.Request) { + templating.RenderTemplate(getController.App, w, "templates/pages/register.html", nil) +} diff --git a/routes/getRoutes.go b/routes/getRoutes.go index c7a946f..f0ae6e5 100644 --- a/routes/getRoutes.go +++ b/routes/getRoutes.go @@ -20,5 +20,7 @@ func GetRoutes(app *app.App) { // Pages http.HandleFunc("/", getController.ShowHome) + http.HandleFunc("/login", getController.ShowLogin) http.HandleFunc("/register", getController.ShowRegister) + http.HandleFunc("/logout", getController.Logout) }