GoDown/app/handlers/api/20_GET_api_db.go

15 lines
237 B
Go
Raw Permalink Normal View History

2022-04-29 01:00:04 +02:00
package api
import (
"net/http"
"github.com/gin-gonic/gin"
)
func GET_api_db(c *gin.Context) {
dbquery := "SELECT * FROM testdb.media"
media, err := getJSON(dbquery)
check(err)
c.Data(http.StatusOK, "application/json", media)
}