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