From cefe5ecedb98520098312c979bebf85ae5199e09 Mon Sep 17 00:00:00 2001 From: Jonathan Barrow Date: Tue, 5 Oct 2021 09:17:04 -0400 Subject: [PATCH] changed mongo URI to env variable --- database.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/database.go b/database.go index 8d28ecf..80bc7c1 100644 --- a/database.go +++ b/database.go @@ -5,6 +5,7 @@ import ( "flag" "fmt" "log" + "os" "time" "github.com/PretendoNetwork/nex-go" @@ -23,7 +24,7 @@ var mongoDatabase *mongo.Database var mongoCollection *mongo.Collection func connectMongo() { - mongoClient, _ = mongo.NewClient(options.Client().ApplyURI("mongodb://143.198.126.113:27017/")) + mongoClient, _ = mongo.NewClient(options.Client().ApplyURI(os.Getenv("MONGO_URI"))) mongoContext, _ = context.WithTimeout(context.Background(), 10*time.Second) _ = mongoClient.Connect(mongoContext)