remove the /all functionality completely

This commit is contained in:
lexik 2020-08-11 00:31:52 +02:00
parent a793e3d22c
commit 16f9def792

View file

@ -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{}