Home > Software engineering >  Getting ERROR while connecting MongoDB database to express server
Getting ERROR while connecting MongoDB database to express server

Time:08-03

Error: node: internal /errors :465 ErrorCaptureStackTrace(err) ;

enter image description here

Here is my code:

import express from "express";
import bodyParser from "body-parser";
import mongoose from "mongoose";

const app = express();
app.use(bodyParser.json({ Limit: "30mb", extended: true }));
app.use(bodyParser.urlencoded({ limit: "30mb", extended: true }));

mongoose.connect ("My Uri").
then(()=>app.listen(5000, ()=>console.log("Listening")));

CodePudding user response:

Can you check if your IP is whitelisted from your MongoDB atlas?

  • Related