func (h *Handler) GetURL(c echo.Context) error {
	key := strings.ToLower(c.Param("key"))
	u, err := urlModel.Find(key)
	if err != nil {
		return err
	}
	return c.JSON(http.StatusOK, u)
}
GetURL finds an exact matching url if it exists
package handler
import (
	"net/http"
	"strings"
	"github.com/alexbrazier/go-url/api/config"
	"github.com/labstack/echo"
)
const defaultLimit = 15
func (h *Handler) Search(c echo.Context) error {
	query := strings.ToLower(c.QueryParam("q"))
	u, err := urlModel.Search(query, defaultLimit)
	if err != nil {
		return err
	}
	return c.JSON(http.StatusOK, u)
}
func (h *Handler) SearchSuggestions(c echo.Context) error {
	query := strings.ToLower(c.QueryParam("q"))
	u, err := urlModel.Search(query, defaultLimit)
	if err != nil {
		return err
	}
	var suggestions []string
	for _, url := range u {
		suggestions = append(suggestions, url.Key)
	}
	var result []interface{}
	result = append(result, query)
	result = append(result, suggestions)
	return c.JSON(http.StatusOK, result)
}
func (h *Handler) Opensearch(c echo.Context) error {
	appConfig := config.GetConfig()
	data := map[string]interface{}{
		"domain": appConfig.AppURI,
	}
	return c.Render(http.StatusOK, "opensearch.xml", data)
}
func (h *Handler) Popular(c echo.Context) error {
	limit := 100
	u, err := urlModel.GetMostPopular(limit)
	if err != nil {
		return err
	}
	return c.JSON(http.StatusOK, u)
}