diff options
| -rw-r--r-- | main.go | 6 | 
1 files changed, 6 insertions, 0 deletions
@@ -24,6 +24,7 @@ func printHelp() {  	fmt.Println("    NATS_NKEY - NATS NKEY for authentication (optional)")  	fmt.Println("    NATS_NKEY_SEED - NATS NKEY seed for authentication (optional)")  	fmt.Println("    NATS_CREDS_FILE - Path to NATS credentials file (optional)") +	fmt.Println("    NATS_INBOX_PREFIX - Subject prefix for NATS messages (default: _INBOX)")  	fmt.Println("    HTTP_PORT - HTTP port to listen on (default: 8080)")  } @@ -46,6 +47,7 @@ func main() {  	natsNkey := os.Getenv("NATS_NKEY")  	natsNkeySeed := os.Getenv("NATS_NKEY_SEED")  	natsCredsFile := os.Getenv("NATS_CREDS_FILE") +	natsInboxPrefix := os.Getenv("NATS_INBOX_PREFIX")  	// Read HTTP port from environment variables  	httpPort := os.Getenv("HTTP_PORT") @@ -66,6 +68,10 @@ func main() {  		opts = append(opts, nats.UserCredentials(natsCredsFile))  	} +	if natsInboxPrefix != "" { +		opts = append(opts, nats.CustomInboxPrefix(natsInboxPrefix)) +	} +  	nc, err := nats.Connect(natsURL, opts...)  	if err != nil {  		log.Fatal("Error connecting to NATS:", err)  | 
