Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server running on port undefined #23

Open
ab4041 opened this issue Feb 4, 2025 · 0 comments
Open

Server running on port undefined #23

ab4041 opened this issue Feb 4, 2025 · 0 comments

Comments

@ab4041
Copy link

ab4041 commented Feb 4, 2025

Could not connect to any servers in your MongoDB Atlas cluster. One common reason is that you're trying to access the database from an IP that isn't whitelisted. Make sure your current IP address is on your Atlas cluster's IP whitelist: https://www.mongodb.com/docs/atlas/security-whitelist/
Server running on port undefined

DATABASE_URI = "mongodb+srv://certify:<db_pass>@cluster0.ik8bg.mongodb.net/?retryWrites=true&w=majority&appName=Cluster0"

import mongoose from "mongoose";

export const connectDB = async () => {
try {
await mongoose.connect(process.env.DATABASE_URI);
console.log("Connected to MongoDB");
} catch (err) {
console.log(err.message);
}
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant