add support for embedding templates and other static resources

This feature is disabled by default and can be enabled using the
"bundle" build tag

Fixes #823

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino
2022-07-24 20:02:37 +02:00
parent c8158e14e0
commit 81de7d271e
8 changed files with 268 additions and 58 deletions

View File

@@ -1352,14 +1352,14 @@ func (s *httpdServer) initializeRouter() {
if s.renderOpenAPI {
s.router.Group(func(router chi.Router) {
router.Use(compressor.Handler)
fileServer(router, webOpenAPIPath, http.Dir(s.openAPIPath))
serveStaticDir(router, webOpenAPIPath, s.openAPIPath)
})
}
if s.enableWebAdmin || s.enableWebClient {
s.router.Group(func(router chi.Router) {
router.Use(compressor.Handler)
fileServer(router, webStaticFilesPath, http.Dir(s.staticFilesPath))
serveStaticDir(router, webStaticFilesPath, s.staticFilesPath)
})
if s.binding.OIDC.isEnabled() {
s.router.Get(webOIDCRedirectPath, s.handleOIDCRedirect)