aboutsummaryrefslogtreecommitdiff
path: root/src/auth/routes.go
diff options
context:
space:
mode:
authorAlexander Kavon <hawk@alexkavon.com>2023-11-27 14:48:44 -0500
committerAlexander Kavon <hawk@alexkavon.com>2023-11-27 14:48:44 -0500
commit1d05f918887e9ba4576149513e5df0bb57e6bd72 (patch)
tree2f5e94e21f90183509fe1ae52905c47d67a3c5d0 /src/auth/routes.go
parent8a30281eff35623d1a68642e4d94c814d1b47a0c (diff)
config updates, rename user model, load auth routes, initial templating poc
Diffstat (limited to 'src/auth/routes.go')
-rw-r--r--src/auth/routes.go31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/auth/routes.go b/src/auth/routes.go
new file mode 100644
index 0000000..796d123
--- /dev/null
+++ b/src/auth/routes.go
@@ -0,0 +1,31 @@
+package auth
+
+import (
+ "html/template"
+ "log"
+ "net/http"
+ "os"
+
+ "gitlab.com/alexkavon/newsstand/src/server"
+)
+
+var Routes = server.Routes{
+ server.Route{
+ Name: "Register",
+ Method: "GET",
+ Pattern: "/auth/register",
+ AuthRequired: false,
+ HandlerFunc: Register,
+ },
+}
+
+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 + "/views/templates/main.tmpl.html"))
+ tmpl.Execute(w, nil)
+ }
+}