Skip to content

Commit

Permalink
Add version endpoint to API
Browse files Browse the repository at this point in the history
  • Loading branch information
andrasbacsai committed May 8, 2024
1 parent 5b6005b commit b906728
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/sentinel/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
)

var token string
var version string = "0.0.2"

func Token() gin.HandlerFunc {
return func(c *gin.Context) {
Expand All @@ -32,6 +33,9 @@ func main() {
r.GET("/api/health", func(c *gin.Context) {
c.String(200, "ok")
})
r.GET("/api/version", func(c *gin.Context) {
c.String(200, version)
})
r.Use(gin.Recovery())

authorized := r.Group("/api")
Expand Down

0 comments on commit b906728

Please sign in to comment.