I am deploying a full stack application on render. But I don’t know why I am getting this
MongooseServerSelectionError: connect ECONNREFUSED 0.0.0.0:27017
at _handleConnectionErrors (/opt/render/project/src/node_modules/mongoose/lib/connection.js:897:11)
at NativeConnection.openUri (/opt/render/project/src/node_modules/mongoose/lib/connection.js:848:11) {
reason: TopologyDescription {
type: 'Unknown',
servers: Map(1) { '0.0.0.0:27017' => [ServerDescription] },
stale: false,
compatible: true,
heartbeatFrequencyMS: 10000,
localThresholdMS: 15,
setName: null,
maxElectionId: null,
maxSetVersion: null,
commonWireVersion: 0,
logicalSessionTimeoutMinutes: null
},
code: undefined
}
error in the render logs. My database is also running fine but I don’t know why my application is not running.
I have used this code for my mongodb connection. `
const mongoose = require("mongoose");
mongoose
.connect(process.env.MONGODB_URI)
.then(() => {
console.log("connected");
})
.catch((err) => {
console.log(err);
});
Thankyou.
My page keeps crashing when I log in
New contributor
khiladi coder is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.