fix(api/docs): Use Base in redoc template
This commit is contained in:
parent
fb0d0cb32c
commit
3a5ba17ca0
|
|
@ -53,10 +53,10 @@ func DocsJSON(c *echo.Context) error {
|
|||
// RedocUI serves everything needed to provide the redoc ui
|
||||
func RedocUI(c *echo.Context) error {
|
||||
publicURL := config.ServicePublicURL.GetString()
|
||||
docsURL := strings.TrimRight(publicURL, "/") + "/api/v1/docs.json"
|
||||
docsBase := strings.TrimRight(publicURL, "/") + "/"
|
||||
|
||||
var buf bytes.Buffer
|
||||
data := map[string]string{"Url": docsURL}
|
||||
data := map[string]string{"Base": docsBase}
|
||||
|
||||
if err := redocUITemplate.Execute(&buf, data); err != nil {
|
||||
return err
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
<style>body{margin:0;padding:0;}</style>
|
||||
</head>
|
||||
<body>
|
||||
<redoc spec-url='{{.Url}}'></redoc>
|
||||
<script src="/api/v1/docs/redoc.standalone.js"></script>
|
||||
<redoc spec-url='{{.Base}}api/v1/docs.json'></redoc>
|
||||
<script src="{{.Base}}api/v1/docs/redoc.standalone.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
Loading…
Reference in New Issue