17 lines
342 B
Go
17 lines
342 B
Go
package api
|
|
|
|
import (
|
|
_ "embed"
|
|
"net/http"
|
|
)
|
|
|
|
//go:embed openapi.json
|
|
var openAPIDocument []byte
|
|
|
|
func (s *Server) documentationRoutes() {
|
|
s.mux.HandleFunc("GET /api/v1/openapi.json", func(w http.ResponseWriter, r *http.Request) {
|
|
w.Header().Set("Content-Type", "application/json; charset=utf-8")
|
|
_, _ = w.Write(openAPIDocument)
|
|
})
|
|
}
|