summaryrefslogtreecommitdiff
path: root/routes.go
diff options
context:
space:
mode:
authortjpcc <tjp@ctrl-c.club>2023-09-17 18:39:02 -0600
committertjpcc <tjp@ctrl-c.club>2023-09-17 18:39:02 -0600
commit8b6ec37932c72e41c66d82337748dc75eba57f25 (patch)
tree02a2cd3414c2ea3980a5eca327f7f0c54039f01e /routes.go
parentb8cd694a2d4e4f12caa413b0407c2b7a7f836d45 (diff)
add syw and gemini and gopher routers at /git/
Diffstat (limited to 'routes.go')
-rw-r--r--routes.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/routes.go b/routes.go
index 08d2c56..83f2868 100644
--- a/routes.go
+++ b/routes.go
@@ -19,6 +19,7 @@ import (
"tildegit.org/tjp/sliderule/gemini/gemtext/atomconv"
"tildegit.org/tjp/sliderule/gopher/gophermap"
"tildegit.org/tjp/sliderule/logging"
+ "tildegit.org/tjp/syw"
)
func geminiRouter(conf config) sr.Handler {
@@ -58,6 +59,10 @@ func geminiRouter(conf config) sr.Handler {
)),
)
+ if conf.geminiRepos != "" {
+ router.Mount("/git", syw.GeminiRouter(conf.geminiRepos, nil))
+ }
+
h := router.Handler()
if conf.geminiAutoAtom {
h = atomconv.Auto(h)
@@ -92,6 +97,10 @@ func gopherRouter(conf config) sr.Handler {
cgi.GopherCGIDirectory("/cgi-bin/", filepath.Join(conf.gopherRoot, "cgi-bin"), &settings),
)
+ if conf.gopherRepos != "" {
+ router.Mount("/git", syw.GopherRouter(conf.gopherRepos, nil))
+ }
+
return router.Handler()
}