aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorr <r@freesoftwareextremist.com>2019-12-25 16:38:47 +0000
committerr <r@freesoftwareextremist.com>2019-12-25 16:38:47 +0000
commit656ff3931cf86c50a0b54da43cbf5f68344c58e0 (patch)
tree611800a2047eb75b62460f0c8a2ec18b0d9ce61a /main.go
parentbde2c03495c0e032415e8bec484fcbbcb9f4c644 (diff)
downloadbloat-656ff3931cf86c50a0b54da43cbf5f68344c58e0.tar.gz
bloat-656ff3931cf86c50a0b54da43cbf5f68344c58e0.zip
Update header template and add option for custom css
Diffstat (limited to 'main.go')
-rw-r--r--main.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/main.go b/main.go
index ad62976..f9fdc8f 100644
--- a/main.go
+++ b/main.go
@@ -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)