default to ./web when Dir and WebFS are not set
update WebFS doc Signed-off-by: Rui Yang <ruiya@vmware.com> Co-authored-by: Aidan Oldershaw <aoldershaw@pivotal.io>
This commit is contained in:
parent
4e569024fd
commit
2f28fc7451
@ -111,8 +111,10 @@ type WebConfig struct {
|
|||||||
//
|
//
|
||||||
Dir string
|
Dir string
|
||||||
|
|
||||||
// A file system includes web static. Will be overwritten by Dir
|
// Alternative way to configure web static filesystem. Dir overrides this.
|
||||||
// It is expected to contain the directories as Dir.
|
// It's expected to contain the same files and directories as mentioned
|
||||||
|
// above in Dir doc.
|
||||||
|
//
|
||||||
WebFS fs.FS
|
WebFS fs.FS
|
||||||
|
|
||||||
// Defaults to "( issuer URL )/theme/logo.png"
|
// Defaults to "( issuer URL )/theme/logo.png"
|
||||||
|
@ -79,6 +79,8 @@ func loadWebConfig(c webConfig) (http.Handler, http.Handler, *templates, error)
|
|||||||
}
|
}
|
||||||
if c.dir != "" {
|
if c.dir != "" {
|
||||||
c.webFS = os.DirFS(c.dir)
|
c.webFS = os.DirFS(c.dir)
|
||||||
|
} else if c.webFS == nil {
|
||||||
|
c.webFS = os.DirFS("./web")
|
||||||
}
|
}
|
||||||
if c.logoURL == "" {
|
if c.logoURL == "" {
|
||||||
c.logoURL = "theme/logo.png"
|
c.logoURL = "theme/logo.png"
|
||||||
|
Reference in New Issue
Block a user