We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2e728de commit c7d049cCopy full SHA for c7d049c
src/lib/mongo.ts
@@ -4,12 +4,15 @@ import * as Sentry from "@sentry/node";
4
require("dotenv").config();
5
6
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);
+ return mongoose
+ .connect(process.env.MONGO_URI, { dbName: process.env.DEVELOPMENT ? "reminders-dev" : "reminders-prod" })
+ .then(() => {
+ console.log("Connected to Database!");
+ })
12
+ .catch((err: Error) => {
13
+ Sentry.captureException(err);
14
+ console.error(err);
15
- process.exit(1);
- })
-}
16
+ process.exit(1);
17
+ });
18
+};
0 commit comments