mirror of
https://github.com/stefanprodan/podinfo.git
synced 2026-02-28 17:10:19 +00:00
- add swagger definitions for all API routes - self-host the swagger UI on `/swagger/` - serve swagger spec on `/swagger.json`
20 lines
371 B
Go
20 lines
371 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) {
|
|
s.JSONResponse(w, r, os.Environ())
|
|
}
|