diff options
author | r <r@freesoftwareextremist.com> | 2020-11-22 17:29:58 +0000 |
---|---|---|
committer | r <r@freesoftwareextremist.com> | 2020-11-22 17:29:58 +0000 |
commit | fa27d9c6eb525b2e55c3faab5dd8a3e0e9658536 (patch) | |
tree | 15561e426c76d5fab44b5e401c2e81b77c0d7553 /main.go | |
parent | 37b1c750454a780ef31a26d19005e5c94a39ae9b (diff) | |
download | bloat-fa27d9c6eb525b2e55c3faab5dd8a3e0e9658536.tar.gz bloat-fa27d9c6eb525b2e55c3faab5dd8a3e0e9658536.zip |
Refactor things
- Remove separate auth/logging and merge them into transport.go
- Add helper function for http handlers
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -12,7 +12,6 @@ import ( "time" "bloat/config" - "bloat/kv" "bloat/renderer" "bloat/repo" "bloat/service" @@ -76,13 +75,13 @@ func main() { } sessionDBPath := filepath.Join(config.DatabasePath, "session") - sessionDB, err := kv.NewDatabse(sessionDBPath) + sessionDB, err := util.NewDatabse(sessionDBPath) if err != nil { errExit(err) } appDBPath := filepath.Join(config.DatabasePath, "app") - appDB, err := kv.NewDatabse(appDBPath) + appDB, err := util.NewDatabse(appDBPath) if err != nil { errExit(err) } @@ -114,9 +113,7 @@ func main() { s := service.NewService(config.ClientName, config.ClientScope, config.ClientWebsite, customCSS, config.PostFormats, renderer, sessionRepo, appRepo, config.SingleInstance) - s = service.NewAuthService(sessionRepo, appRepo, s) - s = service.NewLoggingService(logger, s) - handler := service.NewHandler(s, config.StaticDirectory) + handler := service.NewHandler(s, logger, config.StaticDirectory) logger.Println("listening on", config.ListenAddress) err = http.ListenAndServe(config.ListenAddress, handler) |