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
22 lines
445 B
Go
22 lines
445 B
Go
package http
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"os"
|
|
)
|
|
|
|
// Env godoc
|
|
// @Summary Environment
|
|
// @Description returns the environment variables as a JSON array
|
|
// @Tags HTTP API
|
|
// @Accept json
|
|
// @Produce json
|
|
// @Router /env [get]
|
|
// @Success 200 {object} http.ArrayResponse
|
|
func (s *Server) envHandler(w http.ResponseWriter, r *http.Request) {
|
|
_, span := s.tracer.Start(r.Context(), "envHandler")
|
|
defer span.End()
|
|
s.JSONResponse(w, r, os.Environ())
|
|
}
|