connect to mongoose

PHOTO EMBED

Fri Dec 03 2021 18:33:12 GMT+0000 (UTC)

Saved by @GoatAaron #javascript

require("dotenv").config();
const port = process.env.PORT || 7788;
const mongoUri = process.env.MONGO_URI;
mongoose.connect(mongoUri, {
  useNewUrlParser: true,
});
const connection = mongoose.connection;
connection.once("open", () => {
  console.log("Mongo Docker container running");
});
content_copyCOPY