0
0
mirror of https://github.com/vx3r/wg-gen-web.git synced 2025-09-11 12:24:27 +00:00

add version in back and front #16 / client can ignore global PK #17 / #18 email is now optional

This commit is contained in:
vx3r
2020-02-25 17:45:44 +09:00
parent a98c39ad04
commit 3e1cd8389d
9 changed files with 61 additions and 31 deletions

View File

@ -6,6 +6,7 @@ import (
"github.com/skip2/go-qrcode"
"gitlab.127-0-0-1.fr/vx3r/wg-gen-web/core"
"gitlab.127-0-0-1.fr/vx3r/wg-gen-web/model"
"gitlab.127-0-0-1.fr/vx3r/wg-gen-web/util"
"net/http"
)
@ -27,6 +28,7 @@ func ApplyRoutes(r *gin.Engine) {
{
server.GET("", readServer)
server.PATCH("", updateServer)
server.GET("/version", version)
}
}
@ -200,3 +202,9 @@ func updateServer(c *gin.Context) {
c.JSON(http.StatusOK, client)
}
func version(c *gin.Context) {
c.JSON(http.StatusOK, gin.H{
"version": util.Version,
})
}