Routes and show controller functions for login and logout

This commit is contained in:
max 2022-11-01 11:23:44 -05:00
parent 5a9ee796f8
commit 187d10ca4a
2 changed files with 10 additions and 0 deletions

View File

@ -26,3 +26,11 @@ func (getController *GetController) ShowHome(w http.ResponseWriter, r *http.Requ
func (getController *GetController) ShowRegister(w http.ResponseWriter, r *http.Request) { func (getController *GetController) ShowRegister(w http.ResponseWriter, r *http.Request) {
templating.RenderTemplate(getController.App, w, "templates/pages/register.html", nil) 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)
}

View File

@ -20,5 +20,7 @@ func GetRoutes(app *app.App) {
// Pages // Pages
http.HandleFunc("/", getController.ShowHome) http.HandleFunc("/", getController.ShowHome)
http.HandleFunc("/login", getController.ShowLogin)
http.HandleFunc("/register", getController.ShowRegister) http.HandleFunc("/register", getController.ShowRegister)
http.HandleFunc("/logout", getController.Logout)
} }