mirror of
https://github.com/stefanprodan/podinfo.git
synced 2026-02-28 00:53:49 +00:00
- add swagger definitions for all API routes - self-host the swagger UI on `/swagger/` - serve swagger spec on `/swagger.json`
18 lines
373 B
Go
18 lines
373 B
Go
package api
|
|
|
|
import (
|
|
"net/http"
|
|
)
|
|
|
|
// Headers godoc
|
|
// @Summary Headers
|
|
// @Description returns a JSON array with the request HTTP headers
|
|
// @Tags HTTP API
|
|
// @Accept json
|
|
// @Produce json
|
|
// @Router /headers [get]
|
|
// @Success 200 {object} api.ArrayResponse
|
|
func (s *Server) echoHeadersHandler(w http.ResponseWriter, r *http.Request) {
|
|
s.JSONResponse(w, r, r.Header)
|
|
}
|