mirror of
https://github.com/Dvorinka/MyClubServer.git
synced 2026-06-05 03:02:56 +00:00
dev day #92
This commit is contained in:
@@ -560,6 +560,8 @@ func SetupRoutes(api *gin.RouterGroup, db *gorm.DB) {
|
||||
|
||||
api.GET("/umami/config", umamiController.GetUmamiConfig)
|
||||
api.POST("/umami/initialize-setup", umamiController.InitializeUmamiSetup)
|
||||
// Adblock-safe public alias for config (avoids 'umami' keyword)
|
||||
api.GET("/insights/config", umamiController.GetUmamiConfig)
|
||||
|
||||
umami := api.Group("/admin/umami")
|
||||
umami.Use(middleware.JWTAuth(db))
|
||||
@@ -571,6 +573,17 @@ func SetupRoutes(api *gin.RouterGroup, db *gorm.DB) {
|
||||
umami.GET("/pageviews", umamiController.GetPageviews)
|
||||
}
|
||||
|
||||
// Adblock-safe admin aliases (avoid 'umami'/'metrics' in path)
|
||||
insights := api.Group("/admin/insights")
|
||||
insights.Use(middleware.JWTAuth(db))
|
||||
insights.Use(middleware.RoleAuth("admin"))
|
||||
{
|
||||
insights.POST("/initialize", umamiController.InitializeUmami)
|
||||
insights.GET("/summary", umamiController.GetStats)
|
||||
insights.GET("/breakdown/:type", umamiController.GetMetrics)
|
||||
insights.GET("/pageviews", umamiController.GetPageviews)
|
||||
}
|
||||
|
||||
RegisterContactInfoRoutes(api, db)
|
||||
|
||||
api.POST("/upload", middleware.RateLimit(30, time.Minute), baseController.UploadImage)
|
||||
@@ -618,7 +631,7 @@ func SetupRoutes(api *gin.RouterGroup, db *gorm.DB) {
|
||||
api.GET("/matches", baseController.GetMatches)
|
||||
api.GET("/matches/history", baseController.GetMatchesHistory)
|
||||
api.GET("/standings", baseController.GetStandings)
|
||||
|
||||
|
||||
api.GET("/gallery/albums", galleryController.GetGalleryAlbums)
|
||||
api.GET("/gallery/albums/:id", galleryController.GetGalleryAlbum)
|
||||
api.GET("/gallery/proxy-image", galleryController.ProxyImage)
|
||||
|
||||
Reference in New Issue
Block a user