mirror of
https://github.com/stefanprodan/podinfo.git
synced 2026-03-29 15:16:53 +00:00
22 lines
443 B
Go
22 lines
443 B
Go
package api
|
|
|
|
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} api.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())
|
|
}
|