diff --git a/api/index.ts b/api/index.ts index 40078d4..e212c32 100644 --- a/api/index.ts +++ b/api/index.ts @@ -17,6 +17,7 @@ import morgan from "morgan"; const port = process.env.SERVER_PORT || 3080; const database = process.env.MONGO_URI || "mongodb://localhost:27017"; +const dbName = process.env.MONGO_DB || "lost_and_found_dev"; // https://medium.com/bb-tutorials-and-thoughts/how-to-develop-and-build-react-app-with-nodejs-backend-typescript-version-27a6a283a7c5 // https://github.com/bbachi/react-nodejs-typescript-example @@ -35,6 +36,7 @@ mongoose useNewUrlParser: true, useUnifiedTopology: true, useCreateIndex: true, + dbName, }) .then(() => console.log("Connected to " + database)) .catch(() => console.log("Failed to connect to DB at: " + database));