func New(queueHandler *handlers.QueueHandler) *mux.Router {
	log.Info("Starting router")
	router := mux.NewRouter()

	// Get Router
	getRouter := router.Methods(http.MethodGet).Subrouter()
	getRouter.Use(tokenValidation.Middleware)
	getRouter.HandleFunc("/queue/{id:[0-9a-z-]+}", queueHandler.InQueue)

	//Health Check
	healthRouter := router.Methods(http.MethodGet).Subrouter()
	healthRouter.HandleFunc("/health/live", queueHandler.LivenessCheck)
	healthRouter.HandleFunc("/health/ready", queueHandler.ReadinessCheck)

	// Post router
	postRouter := router.Methods(http.MethodPost).Subrouter()
	postRouter.Use(tokenValidation.Middleware)
	postRouter.HandleFunc("/queue", queueHandler.AddPlayer)
	// postRouter.HandleFunc("/queue/lobby", queueHandler.AddPlayers)
	postRouter.Use(queueHandler.MiddlewarePlayerValidation)

	// Delete router
	deleteRouter := router.Methods(http.MethodDelete).Subrouter()
	deleteRouter.Use(tokenValidation.Middleware)
	deleteRouter.HandleFunc("/queue/{id:[0-9a-z-]+}", queueHandler.Delete)
	// deleteRouter.HandleFunc("/queue/lobby", queueHandler.DeletePlayers)

	return router
}
// Mux route handling with gorilla/mux
Mux route handling with gorilla/mux
// Mux route handling with gorilla / mux
func New(queueHandler *handlers.QueueHandler) *mux.Router {
	log.Info("Starting router")
	router := mux.NewRouter()
	getRouter := router.Methods(http.MethodGet).Subrouter()
	getRouter.Use(tokenValidation.Middleware)
	getRouter.HandleFunc("/queue/{id:[0-9a-z-]+}", queueHandler.InQueue)
	healthRouter := router.Methods(http.MethodGet).Subrouter()
	healthRouter.HandleFunc("/health/live", queueHandler.LivenessCheck)
	healthRouter.HandleFunc("/health/ready", queueHandler.ReadinessCheck)
	postRouter := router.Methods(http.MethodPost).Subrouter()
	postRouter.Use(tokenValidation.Middleware)
	postRouter.HandleFunc("/queue", queueHandler.AddPlayer)
	postRouter.Use(queueHandler.MiddlewarePlayerValidation)
	deleteRouter := router.Methods(http.MethodDelete).Subrouter()
	deleteRouter.Use(tokenValidation.Middleware)
	deleteRouter.HandleFunc("/queue/{id:[0-9a-z-]+}", queueHandler.Delete)
	return router
}
func New ( queueHandler * handlers . QueueHandler ) * mux . Router { log . Info ( " " ) router := mux . NewRouter ( ) getRouter := router . Methods ( http . MethodGet ) . Subrouter ( ) getRouter . Use ( tokenValidation . Middleware ) getRouter . HandleFunc ( " " , queueHandler . InQueue ) healthRouter := router . Methods ( http . MethodGet ) . Subrouter ( ) healthRouter . HandleFunc ( " " , queueHandler . LivenessCheck ) healthRouter . HandleFunc ( " " , queueHandler . ReadinessCheck ) postRouter := router . Methods ( http . MethodPost ) . Subrouter ( ) postRouter . Use ( tokenValidation . Middleware ) postRouter . HandleFunc ( " " , queueHandler . AddPlayer ) postRouter . Use ( queueHandler . MiddlewarePlayerValidation ) deleteRouter := router . Methods ( http . MethodDelete ) . Subrouter ( ) deleteRouter . Use ( tokenValidation . Middleware ) deleteRouter . HandleFunc ( " " , queueHandler . Delete ) return router }
Mux route handling with gorilla/mux
Mux route handling with gorilla / mux
// Get Router //Health Check // Post router // postRouter.HandleFunc("/queue/lobby", queueHandler.AddPlayers) // Delete router // deleteRouter.HandleFunc("/queue/lobby", queueHandler.DeletePlayers)