Skip to content

Commit c7d049c

Browse files
committed
Update mongo.ts
1 parent 2e728de commit c7d049c

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

src/lib/mongo.ts

+11-8
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,15 @@ import * as Sentry from "@sentry/node";
44
require("dotenv").config();
55

66
export default async () => {
7-
return mongoose.connect(process.env.MONGO_URI).then(() => {
8-
console.log("Connected to Database!");
9-
}).catch((err: Error) => {
10-
Sentry.captureException(err);
11-
console.error(err);
7+
return mongoose
8+
.connect(process.env.MONGO_URI, { dbName: process.env.DEVELOPMENT ? "reminders-dev" : "reminders-prod" })
9+
.then(() => {
10+
console.log("Connected to Database!");
11+
})
12+
.catch((err: Error) => {
13+
Sentry.captureException(err);
14+
console.error(err);
1215

13-
process.exit(1);
14-
})
15-
}
16+
process.exit(1);
17+
});
18+
};

0 commit comments

Comments
 (0)