GoDown/app/handlers/api/20_GET_api_get_ytid.go
2022-04-29 01:00:04 +02:00

17 lines
320 B
Go

package api
import (
"fmt"
"net/http"
"github.com/gin-gonic/gin"
)
func GET_api_get_ytid(c *gin.Context) {
ytid := c.Param("ytid")
sqlString := fmt.Sprintf("SELECT * FROM testdb.media WHERE ytid LIKE \"%v\";", ytid)
json, err := getJSON(sqlString)
check(err)
c.Data(http.StatusOK, "application/json", json)
}