-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
7 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ package templates | |
|
||
import ( | ||
_ "embed" | ||
"fmt" | ||
"html/template" | ||
"net/http" | ||
|
||
|
@@ -18,29 +17,6 @@ var swaggerFile string | |
var reDocTemplate = assert.Exit1(template.New("").Parse(reDocFile)) | ||
var swaggerTemplate = assert.Exit1(template.New("").Parse(swaggerFile)) | ||
|
||
func RapiDocHandler(title, url string) http.HandlerFunc { | ||
return func(writer http.ResponseWriter, request *http.Request) { | ||
writer.Header().Set("Content-Type", "text/html") | ||
writer.Write([]byte(fmt.Sprintf(`<!doctype html> | ||
<html> | ||
<head> | ||
<title>%s</title> | ||
<meta charset="utf-8"> | ||
<script type="module" src="https://unpkg.com/[email protected]/dist/rapidoc-min.js"></script> | ||
</head> | ||
<body> | ||
<rapi-doc | ||
spec-url="%s" | ||
render-style="read" | ||
show-header="false" | ||
primary-color="#f74799" | ||
nav-accent-color="#47afe8" | ||
> </rapi-doc> | ||
</body> | ||
</html>`, title, url))) | ||
} | ||
} | ||
|
||
func ReDocHandler(title, url string) http.HandlerFunc { | ||
return func(writer http.ResponseWriter, request *http.Request) { | ||
writer.Header().Set("Content-Type", "text/html") | ||
|