The statik.go
file contains the SwaggerUI, all of the dependencies and requirements.
For some reason if you need to recreate it, do the following steps:
-
Downloading SwaggerUI files
SwaggerUI can be downloaded from their GitHub Repo. Once downloaded, place the dist
folder into this folder.
Inside index.html change URL to ./swagger.yaml
-
Compile the files to a binary
For this step, install statik
from https://github.com/rakyll/statik then run the following command:
statik -src={PATH_TO_THIS_FOLDER}/projects/src/github.com/gig/go-swagger-ui/dist
A new folder statik will be created, and inside a single go file, statik.go
. ( It’s unreadable, so don’t bother with that. ) Copy the statik.go
to this directory and remove the rest of the files.
Credits: https://medium.com/@ribice/serve-swaggerui-within-your-golang-application-5486748a5ed4