Moving swagger-ui files from www/swagger-ui to third-party/swagger-ui
and adding LICENSE and README filespull/6/head
|
@ -33,7 +33,7 @@ fi
|
||||||
DATAFILE=pkg/ui/datafile.go
|
DATAFILE=pkg/ui/datafile.go
|
||||||
TMP_DATAFILE=/tmp/datafile.go
|
TMP_DATAFILE=/tmp/datafile.go
|
||||||
|
|
||||||
go-bindata -nocompress -o $DATAFILE -prefix ${PWD} -pkg ui www/...
|
go-bindata -nocompress -o $DATAFILE -prefix ${PWD} -pkg ui www/... third_party/swagger-ui/...
|
||||||
|
|
||||||
cat hooks/boilerplate.go.txt > $TMP_DATAFILE
|
cat hooks/boilerplate.go.txt > $TMP_DATAFILE
|
||||||
echo "// generated by hack/build-ui.sh; DO NOT EDIT
|
echo "// generated by hack/build-ui.sh; DO NOT EDIT
|
||||||
|
|
|
@ -419,7 +419,7 @@ func (m *Master) InstallSwaggerAPI() {
|
||||||
// TODO: Parameterize the path?
|
// TODO: Parameterize the path?
|
||||||
ApiPath: "/swaggerapi/",
|
ApiPath: "/swaggerapi/",
|
||||||
SwaggerPath: "/swaggerui/",
|
SwaggerPath: "/swaggerui/",
|
||||||
SwaggerFilePath: "/static/swagger-ui/",
|
SwaggerFilePath: "/swagger-ui/",
|
||||||
}
|
}
|
||||||
swagger.RegisterSwaggerService(swaggerConfig, m.handlerContainer)
|
swagger.RegisterSwaggerService(swaggerConfig, m.handlerContainer)
|
||||||
}
|
}
|
||||||
|
|
1276
pkg/ui/datafile.go
|
@ -22,13 +22,18 @@ import (
|
||||||
assetfs "github.com/elazarl/go-bindata-assetfs"
|
assetfs "github.com/elazarl/go-bindata-assetfs"
|
||||||
)
|
)
|
||||||
|
|
||||||
const prefix = "/static/"
|
|
||||||
|
|
||||||
type MuxInterface interface {
|
type MuxInterface interface {
|
||||||
Handle(pattern string, handler http.Handler)
|
Handle(pattern string, handler http.Handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
func InstallSupport(mux MuxInterface) {
|
func InstallSupport(mux MuxInterface) {
|
||||||
|
// Expose files in www/ on <host>/static/
|
||||||
fileServer := http.FileServer(&assetfs.AssetFS{Asset: Asset, AssetDir: AssetDir, Prefix: "www"})
|
fileServer := http.FileServer(&assetfs.AssetFS{Asset: Asset, AssetDir: AssetDir, Prefix: "www"})
|
||||||
|
prefix := "/static/"
|
||||||
|
mux.Handle(prefix, http.StripPrefix(prefix, fileServer))
|
||||||
|
|
||||||
|
// Expose files in third_party/swagger-ui/ on <host>/swagger-ui/
|
||||||
|
fileServer = http.FileServer(&assetfs.AssetFS{Asset: Asset, AssetDir: AssetDir, Prefix: "third_party/swagger-ui"})
|
||||||
|
prefix = "/swagger-ui/"
|
||||||
mux.Handle(prefix, http.StripPrefix(prefix, fileServer))
|
mux.Handle(prefix, http.StripPrefix(prefix, fileServer))
|
||||||
}
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
Copyright 2014 Reverb Technologies, Inc.
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at [apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
|
@ -0,0 +1,20 @@
|
||||||
|
# Readme
|
||||||
|
|
||||||
|
URL: https://github.com/swagger-api/swagger-ui/tree/master/dist
|
||||||
|
License: Apache License, Version 2.0
|
||||||
|
License File: LICENSE
|
||||||
|
|
||||||
|
## Description
|
||||||
|
Files from dist folder of https://github.com/swagger-api/swagger-ui.
|
||||||
|
These are dependency-free collection of HTML, Javascript, and CSS assets that
|
||||||
|
dynamically generate beautiful documentation and sandbox from a
|
||||||
|
Swagger-compliant API.
|
||||||
|
Instructions on how to use these:
|
||||||
|
https://github.com/swagger-api/swagger-ui#how-to-use-it
|
||||||
|
|
||||||
|
## Local Modifications
|
||||||
|
Updated the url to "../../swaggerapi" as per instructions at:
|
||||||
|
https://github.com/swagger-api/swagger-ui#how-to-use-it
|
||||||
|
|
||||||
|
LICENSE file has been created for compliance purposes.
|
||||||
|
Not included in original distribution.
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.6 KiB |
Before Width: | Height: | Size: 770 B After Width: | Height: | Size: 770 B |
Before Width: | Height: | Size: 824 B After Width: | Height: | Size: 824 B |
Before Width: | Height: | Size: 9.0 KiB After Width: | Height: | Size: 9.0 KiB |
Before Width: | Height: | Size: 980 B After Width: | Height: | Size: 980 B |