From 16f9def7922eb4bfef0bb34da8f8ac7e622f0970 Mon Sep 17 00:00:00 2001 From: lexik Date: Tue, 11 Aug 2020 00:31:52 +0200 Subject: [PATCH] remove the /all functionality completely --- handlers/handlers.go | 9 --------- 1 file changed, 9 deletions(-) diff --git a/handlers/handlers.go b/handlers/handlers.go index e87e8a8..974e88f 100644 --- a/handlers/handlers.go +++ b/handlers/handlers.go @@ -37,15 +37,6 @@ func (a *App) Initialize(dbDriver string, dbURI string) { db.AutoMigrate(&urlEntry{}) } -// ListAll returns a JSON response of all the url entries in the database -func (a *App) ListAll(w http.ResponseWriter, r *http.Request) { - res := &[]urlEntry{} - a.DB.Find(res) - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - json.NewEncoder(w).Encode(res) -} - // GetURL takes a shortlink and redirects the user to the relevant link if it exists func (a *App) GetURL(w http.ResponseWriter, r *http.Request) { u := &urlEntry{}