diff options
author | r <r@freesoftwareextremist.com> | 2019-12-25 16:38:47 +0000 |
---|---|---|
committer | r <r@freesoftwareextremist.com> | 2019-12-25 16:38:47 +0000 |
commit | 656ff3931cf86c50a0b54da43cbf5f68344c58e0 (patch) | |
tree | 611800a2047eb75b62460f0c8a2ec18b0d9ce61a /main.go | |
parent | bde2c03495c0e032415e8bec484fcbbcb9f4c644 (diff) | |
download | bloat-656ff3931cf86c50a0b54da43cbf5f68344c58e0.tar.gz bloat-656ff3931cf86c50a0b54da43cbf5f68344c58e0.zip |
Update header template and add option for custom css
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -6,6 +6,7 @@ import ( "net/http" "os" "path/filepath" + "strings" "time" "web/config" @@ -52,6 +53,12 @@ func main() { sessionRepo := repository.NewSessionRepository(sessionDB) appRepo := repository.NewAppRepository(appDB) + customCSS := config.CustomCSS + if !strings.HasPrefix(customCSS, "http://") && + !strings.HasPrefix(customCSS, "https://") { + customCSS = "/static/" + customCSS + } + var logger *log.Logger if len(config.Logfile) < 1 { logger = log.New(os.Stdout, "", log.LstdFlags) @@ -64,7 +71,7 @@ func main() { logger = log.New(lf, "", log.LstdFlags) } - s := service.NewService(config.ClientName, config.ClientScope, config.ClientWebsite, renderer, sessionRepo, appRepo) + s := service.NewService(config.ClientName, config.ClientScope, config.ClientWebsite, customCSS, renderer, sessionRepo, appRepo) s = service.NewAuthService(sessionRepo, appRepo, s) s = service.NewLoggingService(logger, s) handler := service.NewHandler(s, config.StaticDirectory) |