add version route
This commit is contained in:
parent
a8d35cfa6c
commit
c1ff9e0ec7
@ -15,6 +15,7 @@ import (
|
||||
)
|
||||
|
||||
var LDAPSessions map[string]*LDAPClient
|
||||
var APIVersion = "1.0.0"
|
||||
|
||||
func Run() {
|
||||
gob.Register(LDAPClient{})
|
||||
@ -38,6 +39,10 @@ func Run() {
|
||||
|
||||
LDAPSessions = make(map[string]*LDAPClient)
|
||||
|
||||
router.GET("/version", func(c *gin.Context) {
|
||||
c.JSON(http.StatusOK, gin.H{"version": APIVersion})
|
||||
})
|
||||
|
||||
router.POST("/ticket", func(c *gin.Context) {
|
||||
var body Login
|
||||
if err := c.ShouldBind(&body); err != nil { // bad request from binding
|
||||
|
Loading…
Reference in New Issue
Block a user