-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
35 lines (28 loc) · 718 Bytes
/
Copy pathmain.go
File metadata and controls
35 lines (28 loc) · 718 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package main
import (
"fmt"
"github.com/gin-gonic/gin"
"message_queue_service/config"
"message_queue_service/consumer"
"message_queue_service/routes"
"net/http"
)
func main() {
fmt.Println("--------------------Starting Ecommerce Service--------------------")
config.InitializeEnv()
config.InitializeDB()
config.InitializeProducer()
config.InitializeConsumer()
go consumer.StartConsumer()
server := gin.New()
group := server.Group("/api/ecommerce")
routes.InitializeRoutes(group)
routes.GetRegisteredRoutes(server)
// health check URL
group.GET("/ping", func(c *gin.Context) {
c.JSON(http.StatusOK, gin.H{"status": "alive"})
})
if err := server.Run(":5002"); err != nil {
panic(err)
}
}