// Run loads server with its routes and starts the server
Run loads server with its routes and starts the server
// Run loads server with its routes and starts the server
func (s *Server) Run() {
	r := gin.Default()
	r.Use(*s.middleware.Cors())
	r.HandleMethodNotAllowed = false
	r.NoRoute(s.handlers.NotFound)
	userApi := r.Group("/api/v1/user")
	{
		userApi.POST("", s.userController.CreateAction)
		userApi.POST("/jwt", s.userController.LoginAction)
	}
	roleApi := r.Group("/api/v1/role")
	{
		roleApi.POST("", s.roleController.CreateAction)
	}
	r.Run(s.config.Host)
}
func ( s * Server ) Run ( ) { r := gin . Default ( ) r . Use ( * s . middleware . Cors ( ) ) r . HandleMethodNotAllowed = false r . NoRoute ( s . handlers . NotFound ) userApi := r . Group ( " " ) { userApi . POST ( " " , s . userController . CreateAction ) userApi . POST ( " " , s . userController . LoginAction ) } roleApi := r . Group ( " " ) { roleApi . POST ( " " , s . roleController . CreateAction ) } r . Run ( s . config . Host ) }
Run loads server with its routes and starts the server
Run loads server with its routes and starts the server
// Instantiate a new router // cors // generic routes // User resource // Create a new user // Emit a jwt token // Roles resource // Create a new role // Fire up the server