Enabling Go Modules and refactoring our code to use packages

This commit is contained in:
2024-04-17 17:06:39 -06:00
parent a64a032324
commit 72ac372111
4 changed files with 56 additions and 0 deletions

17
pkg/handlers/handlers.go Normal file
View File

@@ -0,0 +1,17 @@
package handlers
import (
"net/http"
"gitea.sitodosi.com/betology/curso/pkg/render"
)
// Home is the home page handler
func Home(w http.ResponseWriter, r *http.Request) {
render.RenderTemplate(w, "home.page.tmpl")
}
// About is the about page handler
func About(w http.ResponseWriter, r *http.Request) {
render.RenderTemplate(w, "about.page.tmpl")
}