diff options
| author | Alexander Kavon <hawk@alexkavon.com> | 2023-11-28 00:45:37 -0500 |
|---|---|---|
| committer | Alexander Kavon <hawk@alexkavon.com> | 2023-11-28 00:45:37 -0500 |
| commit | 7d7059d53891bc1abb284d9b288505a5d406b307 (patch) | |
| tree | f3ae7435a0a67ce1e5c939966738fea01bb9644e /src/auth/routes.go | |
| parent | d7d2b376405d91a201b8b830160458c5dd6df4a9 (diff) | |
build ui and render templates, build routes
Diffstat (limited to 'src/auth/routes.go')
| -rw-r--r-- | src/auth/routes.go | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/auth/routes.go b/src/auth/routes.go index 4f161de..5a28756 100644 --- a/src/auth/routes.go +++ b/src/auth/routes.go @@ -1,10 +1,7 @@ package auth import ( - "html/template" - "log" "net/http" - "os" "gitlab.com/alexkavon/newsstand/src/server" ) @@ -13,7 +10,7 @@ var Routes = server.Routes{ server.Route{ Name: "Register", Method: "GET", - Pattern: "/auth/register", + Path: "/auth/register", AuthRequired: false, HandlerFunc: Register, }, @@ -21,11 +18,6 @@ var Routes = server.Routes{ func Register(s *server.Server) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { - cwd, err := os.Getwd() - if err != nil { - log.Fatal(err) - } - tmpl := template.Must(template.ParseFiles(cwd+"/ui/templates/base.tmpl.html", cwd+"/ui/pages/auth/register.tmpl.html")) - tmpl.ExecuteTemplate(w, "base", nil) + s.Ui.Render(w, "auth/register", nil) } } |
