Documentation
¶
Index ¶
- func AddStaticDirectoryRoute(server chi.Router, relativeFilesystemPath string, uriPath string)
- func AddStaticHttpFilesystemRoute(server chi.Router, fs http.FileSystem, uriPath string)
- func AddStaticSingleFileRoute(server chi.Router, relativeFilesystemPath string, uriPath string, ...)
- func SetupSwaggerRoutes(server chi.Router)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddStaticDirectoryRoute ¶
serve static files from a directory via a chi router
inspired by https://github.com/go-chi/chi/blob/master/_examples/fileserver/main.go
parameters:
- relativeFilesystemPath where to find the file(s) to serve relative to the current working directory example: "third_party/swagger_ui" note: do NOT add a trailing slash
- uriPath under which sub-url they should be served, if you leave out trailing slash, also adds a redirect example: "/swagger-ui"
func AddStaticHttpFilesystemRoute ¶
func AddStaticHttpFilesystemRoute(server chi.Router, fs http.FileSystem, uriPath string)
serve static files from an http.FileSystem instance via a chi router
inspired by https://github.com/go-chi/chi/blob/master/_examples/fileserver/main.go
parameters:
- uriPath under which sub-url they should be served, if you leave out trailing slash, also adds a redirect example: "/swagger-ui"
func AddStaticSingleFileRoute ¶
func AddStaticSingleFileRoute(server chi.Router, relativeFilesystemPath string, uriPath string, filename string)
serve a single static file via a chi router
parameters:
- relativeFilesystemPath where to find the file(s) to serve relative to the current working directory example: "docs" note: do NOT add a trailing slash
- uriPath under which sub-url they should be served example: "/"
- filename which exact file to serve. This will be added to the route, so only exactly this file is made available example: "swagger.json"
func SetupSwaggerRoutes ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.