about summary refs log tree commit diff stats
path: root/cmd/server
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/server')
-rw-r--r--cmd/server/main.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/cmd/server/main.go b/cmd/server/main.go
index 652ffa3..01b8c54 100644
--- a/cmd/server/main.go
+++ b/cmd/server/main.go
@@ -6,6 +6,7 @@ import (
 	"os"
 	"os/signal"
 
+	"go.alanpearce.eu/website/internal/nats"
 	"go.alanpearce.eu/website/internal/server"
 	"go.alanpearce.eu/x/log"
 
@@ -52,8 +53,16 @@ func main() {
 		}
 	}()
 
+	go func() {
+		err := nats.Start(log.Named("nats"))
+		if err != nil {
+			log.Warn("could not start NATS server", "error", err)
+		}
+	}()
+
 	<-ctx.Done()
 	log.Debug("calling stop")
 	<-sv.Stop()
+	nats.Stop()
 	log.Debug("done")
 }