backend/internal/api/api.go

26 lines
446 B
Go

package api
import (
"net/http"
"github.com/gin-gonic/gin"
"stereo.cat/backend/internal/types"
)
func Register(cfg *types.StereoConfig) []types.Route {
routes := []types.Route{
{
Path: "/ping",
Method: http.MethodGet,
Exec: func(cfg *types.StereoConfig) gin.HandlerFunc {
return func(c *gin.Context) {
c.String(http.StatusOK, "Pong!")
}
},
},
}
types.RegisterRoutes("/api", routes, cfg)
return routes
}