diff --git a/.travis.yml b/.travis.yml index 9e4e70578..71a926d61 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,4 +20,4 @@ script: - go test $(go list ./... | grep -v /vendor/) -cover -bench=. -benchmem after_success: - test -n "$TRAVIS_TAG" && curl -sL https://git.io/goreleaser | bash \ No newline at end of file + test -n "$TRAVIS_TAG" && curl -sL https://git.io/goreleaser | VERSION=v0.20.0 bash \ No newline at end of file diff --git a/cmd/flowserver/main.go b/cmd/flowserver/main.go index 4aae00683..38a14a491 100644 --- a/cmd/flowserver/main.go +++ b/cmd/flowserver/main.go @@ -43,7 +43,6 @@ func main() { r.Use(middleware.RequestID) r.Use(middleware.RealIP) r.Use(lg.RequestLogger(logger)) - r.Use(middleware.Heartbeat("/ping")) r.Use(middleware.Recoverer) r.Use(middleware.Timeout(60 * time.Second)) @@ -64,6 +63,7 @@ func main() { // root page just serves our example and "postman"" interface r.Get("/", templateHandler(staticDir, indexHandler)) + r.Get("/version", jsonHandler(handleVersion)) r.Post("/flow/start", jsonHandler(handleStart)) r.Post("/flow/resume", jsonHandler(handleResume)) @@ -161,3 +161,10 @@ func templateHandler(fs http.FileSystem, handler templateHandlerFunc) http.Handl } } } + +func handleVersion(w http.ResponseWriter, r *http.Request) (interface{}, error) { + response := map[string]string{ + "version": version, + } + return response, nil +} diff --git a/cmd/flowserver/static/index.html b/cmd/flowserver/static/index.html index 6be020e6e..c8c8f7ab0 100644 --- a/cmd/flowserver/static/index.html +++ b/cmd/flowserver/static/index.html @@ -42,8 +42,8 @@