Stack of changes to get gin, scs, nosurf running.
This commit is contained in:
@@ -1,13 +1,20 @@
|
||||
package routes
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
"net/http"
|
||||
stats "synlotto-website/internal/handlers/statistics"
|
||||
|
||||
handlers "synlotto-website/internal/handlers/statistics"
|
||||
"synlotto-website/internal/http/middleware"
|
||||
"synlotto-website/internal/platform/bootstrap"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func SetupStatisticsRoutes(mux *http.ServeMux, db *sql.DB) {
|
||||
mux.HandleFunc("/statistics/thunderball", middleware.Auth(true)(handlers.StatisticsThunderball(db)))
|
||||
// RegisterStatisticsRoutes mounts protected statistics endpoints under /statistics.
|
||||
func RegisterStatisticsRoutes(app *bootstrap.App) {
|
||||
r := app.Router
|
||||
|
||||
group := r.Group("/statistics")
|
||||
group.Use(middleware.AuthMiddleware(), middleware.RequireAuth())
|
||||
|
||||
group.GET("/thunderball", gin.WrapH(stats.StatisticsThunderball(app)))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user