Skip to content

Commit

Permalink
Fixed routing, no more VersionModule
Browse files Browse the repository at this point in the history
  • Loading branch information
applejag committed May 11, 2021
1 parent ecac7eb commit 2f9fe3c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ func main() {
r.GET("/", func(c *gin.Context) { c.JSON(200, gin.H{"message": "pong"}) })
r.POST("/import/gitlab", RunGitLabHandler)
r.POST("/import/gitlab/trigger", RunGitLabTrigger)
r.GET("/import/gitlab/version", getVersionHandler)
r.GET("/import/gitlab/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler))

err := r.Run()
Expand Down
10 changes: 2 additions & 8 deletions version.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,11 @@ func init() {
}
}

type VersionModule struct{}

func (m VersionModule) Register(g *gin.RouterGroup) {
g.GET("/version", m.getVersion)
}

// getVersion godoc
// @summary Returns the version of this API
// @tags meta
// @success 200 {object} Version
// @router /version [get]
func (m VersionModule) getVersion(c *gin.Context) {
// @router /gitlab/version [get]
func getVersionHandler(c *gin.Context) {
c.JSON(http.StatusOK, ApiVersion)
}

0 comments on commit 2f9fe3c

Please sign in to comment.