Restructure routes
This commit is contained in:
@@ -18,13 +18,13 @@ func SetupMiddlewares(group *gin.RouterGroup) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func SetupRoutes(router *gin.Engine) {
|
func SetupRoutes(router *gin.Engine) {
|
||||||
group := router.Group(command.Opts.Prefix)
|
root := router.Group(command.Opts.Prefix)
|
||||||
|
|
||||||
group.GET("/", GetHome)
|
root.GET("/", GetHome)
|
||||||
group.GET("/static/*path", GetAsset)
|
root.GET("/static/*path", GetAsset)
|
||||||
|
root.GET("/connect/:resource", ConnectWithBackend)
|
||||||
|
|
||||||
api := group.Group("/api")
|
api := root.Group("/api")
|
||||||
{
|
|
||||||
SetupMiddlewares(api)
|
SetupMiddlewares(api)
|
||||||
|
|
||||||
if command.Opts.Sessions {
|
if command.Opts.Sessions {
|
||||||
@@ -52,7 +52,4 @@ func SetupRoutes(router *gin.Engine) {
|
|||||||
api.GET("/history", GetHistory)
|
api.GET("/history", GetHistory)
|
||||||
api.GET("/bookmarks", GetBookmarks)
|
api.GET("/bookmarks", GetBookmarks)
|
||||||
api.GET("/export", DataExport)
|
api.GET("/export", DataExport)
|
||||||
}
|
|
||||||
|
|
||||||
group.GET("/connect/:resource", ConnectWithBackend)
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user