aboutsummaryrefslogtreecommitdiff
path: root/forged/internal/incoming/web/handlers
diff options
context:
space:
mode:
Diffstat (limited to 'forged/internal/incoming/web/handlers')
-rw-r--r--forged/internal/incoming/web/handlers/index.go15
-rw-r--r--forged/internal/incoming/web/handlers/repo/index.go20
2 files changed, 35 insertions, 0 deletions
diff --git a/forged/internal/incoming/web/handlers/index.go b/forged/internal/incoming/web/handlers/index.go
new file mode 100644
index 0000000..773a0c6
--- /dev/null
+++ b/forged/internal/incoming/web/handlers/index.go
@@ -0,0 +1,15 @@
+package handlers
+
+import (
+ "net/http"
+
+ wtypes "go.lindenii.runxiyu.org/forge/forged/internal/incoming/web/types"
+)
+
+type IndexHTTP struct{}
+
+func NewIndexHTTP() *IndexHTTP { return &IndexHTTP{} }
+
+func (h *IndexHTTP) Index(w http.ResponseWriter, r *http.Request, _ wtypes.Vars) {
+ _, _ = w.Write([]byte("index: replace with template render"))
+}
diff --git a/forged/internal/incoming/web/handlers/repo/index.go b/forged/internal/incoming/web/handlers/repo/index.go
new file mode 100644
index 0000000..3a6d7ea
--- /dev/null
+++ b/forged/internal/incoming/web/handlers/repo/index.go
@@ -0,0 +1,20 @@
+package repo
+
+import (
+ "fmt"
+ "net/http"
+ "strings"
+
+ wtypes "go.lindenii.runxiyu.org/forge/forged/internal/incoming/web/types"
+)
+
+type HTTP struct{}
+
+func NewHTTP() *HTTP { return &HTTP{} }
+
+func (h *HTTP) Index(w http.ResponseWriter, r *http.Request, v wtypes.Vars) {
+ base := wtypes.Base(r)
+ repo := v["repo"]
+ _, _ = w.Write([]byte(fmt.Sprintf("repo index: group=%q repo=%q",
+ "/"+strings.Join(base.GroupPath, "/")+"/", repo)))
+}