Add log buffer site
This commit is contained in:
8
main.go
8
main.go
@@ -9,6 +9,7 @@ import (
|
||||
"log"
|
||||
"time"
|
||||
"trikotwaschliste/database/migrations"
|
||||
"trikotwaschliste/logbuffer"
|
||||
"trikotwaschliste/models"
|
||||
"trikotwaschliste/routes"
|
||||
)
|
||||
@@ -27,11 +28,16 @@ func main() {
|
||||
//Start postgres connection
|
||||
pool := createDatabasePool(cfg)
|
||||
|
||||
// Init the logging buffer for online log view
|
||||
logbuf := logbuffer.New()
|
||||
r.Use(logbuffer.UseLogBuffer(logbuf))
|
||||
|
||||
r.LoadHTMLGlob("html/**/*")
|
||||
r.Static("/static", "html/static")
|
||||
//r.StaticFile("/favicon.ico", "html/favicon.ico")
|
||||
//routes.RoutesInit(r, pool)
|
||||
routes.RoutesInit(r, pool, &cfg)
|
||||
routes.RoutesInit(r, pool, &cfg, logbuf)
|
||||
|
||||
|
||||
err = r.Run("0.0.0.0:8082")
|
||||
|
||||
|
Reference in New Issue
Block a user