func RegService_thread(wg sync.WaitGroup, serverURI string) { defer wg.Done() // Instantiate a new router r := httprouter.New() cc := controllers.NewCustomerController() r.POST("/customer", cc.CreateCustomer) http.ListenAndServe(serverURI, r) log.Fatalln("Service crashed!") }
func MgtService_thread(wg sync.WaitGroup, serverURI string) { defer wg.Done() // Instantiate a new router r := httprouter.New() cc := controllers.NewCustomerController() r.POST("/customer", cc.CreateCustomer) r.GET("/customer/:id", cc.GetCustomer) r.DELETE("/customer/:id", cc.RemoveCustomer) log.Printf("Mgt Service started: [%s]\n", serverURI) http.ListenAndServe(serverURI, r) log.Fatalln("Service crashed!") }