From 7e4fa87020cf6d04a19a20c3a3151f2c78b57085 Mon Sep 17 00:00:00 2001 From: Özgür Kesim Date: Fri, 14 Jun 2019 11:21:20 +0200 Subject: download link added --- main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'main.go') diff --git a/main.go b/main.go index 07e15b1..de87066 100644 --- a/main.go +++ b/main.go @@ -92,7 +92,7 @@ func (t *Tool) compile() func(http.ResponseWriter, *http.Request) { } } -func (t *Tool) svg() func(http.ResponseWriter, *http.Request) { +func (t *Tool) download() func(http.ResponseWriter, *http.Request) { return func(w http.ResponseWriter, r *http.Request) { name := filepath.Base(r.URL.Path) if file, err := os.Open(filepath.Join(*savedir, name+t.Suffix)); err != nil { @@ -184,7 +184,7 @@ func main() { http.HandleFunc(pre+"c", tool.compile()) http.HandleFunc(pre+"s", tool.save()) http.HandleFunc(pre+"l/", tool.load()) - http.HandleFunc(pre+"svg/", tool.svg()) + http.HandleFunc(pre+"d/", tool.download()) http.HandleFunc(pre, tool.index(tmpl, tools)) log.Println("handler for", pre, "registered") } -- cgit v1.2.3