aboutsummaryrefslogtreecommitdiff
path: root/src/auth
diff options
context:
space:
mode:
Diffstat (limited to 'src/auth')
-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)
+ }
+}