TRA-4263 extensibility refactor (#770)

* Refactor routers

* refactor extension loading

* refactor server creation code

* Update main.go
This commit is contained in:
RamiBerm
2022-02-08 14:59:56 +02:00
committed by GitHub
parent f013b0f03c
commit 0a4674ea7c
13 changed files with 450 additions and 307 deletions

View File

@@ -7,9 +7,15 @@ import (
"github.com/gin-gonic/gin"
)
func QueryRoutes(ginApp *gin.Engine) {
var (
QueryPostValidateHandler = controllers.PostValidate
)
func QueryRoutes(ginApp *gin.Engine) *gin.RouterGroup {
routeGroup := ginApp.Group("/query")
routeGroup.Use(middlewares.RequiresAuth())
routeGroup.POST("/validate", controllers.PostValidate)
routeGroup.POST("/validate", func(c *gin.Context) { QueryPostValidateHandler(c) })
return routeGroup
}