1
0
mirror of https://github.com/mainflux/mainflux.git synced 2025-04-26 13:48:53 +08:00
Mainflux.mainflux/version.go
Dejan Mijić f449f8b9c8
NOISSUE - Fix Content-Type header check (#238)
* Remove charset from required content type

Signed-off-by: Dejan Mijic <dejan@mainflux.com>

* Bump version to 0.2.1

Signed-off-by: Dejan Mijic <dejan@mainflux.com>

* Move constant to transport.go

Signed-off-by: Dejan Mijic <dejan@mainflux.com>
2018-04-22 16:48:06 +02:00

24 lines
399 B
Go

package mainflux
import (
"encoding/json"
"net/http"
)
const version string = "0.2.1"
type response struct {
Version string
}
// Version exposes an HTTP handler for retrieving service version.
func Version() http.HandlerFunc {
return http.HandlerFunc(func(rw http.ResponseWriter, _ *http.Request) {
res := response{Version: version}
data, _ := json.Marshal(res)
rw.Write(data)
})
}