From 9a772809ba51c7a71a2b5f9e20f3a4994bd77a96 Mon Sep 17 00:00:00 2001 From: Peter Stuifzand Date: Sat, 4 Jul 2020 15:07:41 +0200 Subject: [PATCH] Remove fetchLink handler --- main.go | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/main.go b/main.go index 000acb6..7cef2c7 100644 --- a/main.go +++ b/main.go @@ -859,19 +859,6 @@ func main() { w.Header().Set("Content-Type", "application/json") http.ServeFile(w, r, filepath.Join(dataDir, LinksFile)) }) - http.HandleFunc("/fetchLink", func(w http.ResponseWriter, r *http.Request) { - link := r.URL.Query().Get("url") - u, err := url.Parse(link) - if err != nil { - http.Error(w, err.Error(), 400) - return - } - var response LinkResponse - response.Success = 1 - response.Link = u.String() - response.Meta.Title = "Test" - json.NewEncoder(w).Encode(response) - }) http.Handle("/search/", sh) http.Handle("/public/", http.StripPrefix("/public/", http.FileServer(http.Dir("./dist")))) http.Handle("/save/", &saveHandler{})