Initial commit

This commit is contained in:
2025-02-18 09:19:23 +07:00
commit b5859e9e7c
13 changed files with 849 additions and 0 deletions

No files matched your search

+28
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())
}