mirror of
https://github.com/stefanprodan/podinfo.git
synced 2026-04-06 11:06:50 +00:00
Now it is possible to use the swagger webinterface running on a host other than localhost e.g. in docker or kubernetes. Removed the @host line from pkg/api/server.go and ran make swagger. Fixes probably #179
23 lines
486 B
Go
23 lines
486 B
Go
package http
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/stefanprodan/podinfo/pkg/version"
|
|
)
|
|
|
|
// Version godoc
|
|
// @Summary Version
|
|
// @Description returns podinfo version and git commit hash
|
|
// @Tags HTTP API
|
|
// @Produce json
|
|
// @Router /version [get]
|
|
// @Success 200 {object} http.MapResponse
|
|
func (s *Server) versionHandler(w http.ResponseWriter, r *http.Request) {
|
|
result := map[string]string{
|
|
"version": version.VERSION,
|
|
"commit": version.REVISION,
|
|
}
|
|
s.JSONResponse(w, r, result)
|
|
}
|