Files
podinfo/pkg/api/http/env.go
Michael Kebe 16191504d1 Removed reference to localhost from swagger
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
2024-04-09 08:54:38 +02:00

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())
}