We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cdb11b2 commit e80e304Copy full SHA for e80e304
router/router.go
@@ -21,8 +21,9 @@ func InitRoutes() *gin.Engine {
21
router.Use(cors.New(config))
22
23
// Define routing path
24
- router.GET("/"+constants.CURRENT_VERSION+"/:url_id/", middleware.Cache(), controller.GetUrlHandler)
25
- router.POST("/"+constants.CURRENT_VERSION+"/urls/", controller.CreateUrlHandler)
+ versionRouter := router.Group("/" + constants.CURRENT_VERSION)
+ versionRouter.GET("/:url_id/", middleware.Cache(), controller.GetUrlHandler)
26
+ versionRouter.POST("/urls/", controller.CreateUrlHandler)
27
28
// Handling route not existing problem
29
router.NoRoute(controller.MissingRouteHandler)
0 commit comments