Initial commit

This commit is contained in:
2025-01-17 10:55:49 +07:00
commit 562c727ed6
13 changed files with 931 additions and 0 deletions

28
internal/server/routes.go Normal file
View File

@@ -0,0 +1,28 @@
package server
import (
"net/http"
"github.com/gin-gonic/gin"
)
func (s *Server) RegisterRoutes() http.Handler {
r := gin.Default()
r.GET("/", s.HelloWorldHandler)
r.GET("/health", s.healthHandler)
return r
}
func (s *Server) HelloWorldHandler(c *gin.Context) {
resp := make(map[string]string)
resp["message"] = "Hello World"
c.JSON(http.StatusOK, resp)
}
func (s *Server) healthHandler(c *gin.Context) {
c.JSON(http.StatusOK, s.db.Health())
}