gin and user service (WIP)

This commit is contained in:
2025-01-03 11:25:49 +00:00
parent 5d836ac199
commit 2210fe4bb1
5 changed files with 242 additions and 1 deletions
+11 -1
View File
@@ -4,6 +4,8 @@ import (
"actatempus_backend/internal/infrastructure/config"
"fmt"
"net/http"
"github.com/gin-gonic/gin"
)
type Server struct {
@@ -18,5 +20,13 @@ func (s *Server) Start() error {
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
fmt.Fprintln(w, "Welcome to ActaTempus!")
})
return http.ListenAndServe(fmt.Sprintf(":%s", s.cfg.Port), nil)
r := gin.Default()
r.GET("/ping", func(c *gin.Context) {
c.JSON(http.StatusOK, gin.H{
"message": "pong",
})
})
return r.Run()
}