Skip to content

Commit 77815a0

Browse files
committed
added credentials to mongodb connection
1 parent a543f92 commit 77815a0

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

docker/edgev3/webapp/server/cronServer.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,16 @@ const runApp = async () => {
6767
mongoose.set('strictQuery', false);
6868
mongoose
6969
.connect(
70-
db
70+
db,
71+
{
72+
authSource: "admin",
73+
user: config.DATABASE.USERNAME,
74+
pass: config.DATABASE.PASSWORD,
75+
useCreateIndex: true,
76+
useNewUrlParser: true,
77+
useUnifiedTopology: true,
78+
}
79+
)
7180
);
7281
logger.info(`Successfully connected to database ${db}`);
7382
// start server

0 commit comments

Comments
 (0)