Add a JSON version option to make it easier for machine processing

This commit is contained in:
Tracker-Friendly 2024-06-27 18:29:20 +01:00
parent 8e1b3eaec9
commit a7c3a5d364
2 changed files with 1357 additions and 0 deletions

View File

@ -317,6 +317,10 @@ func main() {
c.String(200, "Burgernotes Version 2.0 Beta 1") c.String(200, "Burgernotes Version 2.0 Beta 1")
}) })
router.GET("/api/versionjson", func(c *gin.Context) {
c.JSON(200, gin.H{"name": "Burgernotes", "versiontxt": "Version 2.0 Beta 1", "versionsem": "2.0.0b1", "versionnum": "200"})
})
router.POST("/api/signup", func(c *gin.Context) { router.POST("/api/signup", func(c *gin.Context) {
var data map[string]interface{} var data map[string]interface{}
err := c.ShouldBindJSON(&data) err := c.ShouldBindJSON(&data)

1353
main.go.save Normal file

File diff suppressed because it is too large Load Diff