api: add version info

This commit is contained in:
nemunaire 2019-07-16 16:43:00 +02:00
parent 6d60e29ddf
commit 54a104dc72
1 changed files with 17 additions and 0 deletions

17
api/version.go Normal file
View File

@ -0,0 +1,17 @@
package api
import (
"io"
"github.com/julienschmidt/httprouter"
)
func init() {
router.GET("/api/version", apiHandler(showVersion))
}
func showVersion(_ httprouter.Params, _ io.Reader) Response {
return APIResponse{
response: map[string]interface{}{"version": 0.1},
}
}