From 8b6ec37932c72e41c66d82337748dc75eba57f25 Mon Sep 17 00:00:00 2001 From: tjpcc Date: Sun, 17 Sep 2023 18:39:02 -0600 Subject: add syw and gemini and gopher routers at /git/ --- routes.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'routes.go') 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() } -- cgit v1.2.3