Merge branch 'dev' of ssh://git.iwakura.rip:6969/stereo.cat/backend into dev

This commit is contained in:
hexlocation 2025-05-05 15:19:23 +02:00
commit eb8d1a271c
2 changed files with 17 additions and 18 deletions

View file

@ -1,26 +1,12 @@
package api package api
import ( import (
"net/http" "stereo.cat/backend/internal/api/routes"
"github.com/gin-gonic/gin"
"stereo.cat/backend/internal/types" "stereo.cat/backend/internal/types"
) )
func Register(cfg *types.StereoConfig) []types.Route { func Register(cfg *types.StereoConfig) {
routes := []types.Route{ api := cfg.Router.Group("/api")
{
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) routes.RegisterPingRoutes(api)
return routes
} }

View file

@ -0,0 +1,13 @@
package routes
import (
"net/http"
"github.com/gin-gonic/gin"
)
func RegisterPingRoutes(api *gin.RouterGroup) {
api.GET("/ping", func(c *gin.Context) {
c.String(http.StatusOK, "Pong!")
})
}