Skip to content

Commit

Permalink
update store dir
Browse files Browse the repository at this point in the history
  • Loading branch information
maddalax committed Nov 23, 2024
1 parent 9ef269d commit 8d33ae5
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion app/kv_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,27 @@ package app
import (
"dockside/app/logger"
"github.com/nats-io/nats-server/v2/server"
"runtime"
"time"
)

func MustStartNats() *server.Server {
logger.Info("Starting NATS server")

storeDir := "/data/dockside"

if runtime.GOOS == "windows" {
storeDir = "C:/data/dockside"
}

if runtime.GOOS == "darwin" {
storeDir = "~/.dockside/data"
}

opts := &server.Options{
Port: 4222,
JetStream: true,
StoreDir: "./data",
StoreDir: storeDir,
}

natsServer, err := server.NewServer(opts)
Expand Down

0 comments on commit 8d33ae5

Please sign in to comment.