gin and user service (WIP)
This commit is contained in:
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user