Reputation: 1
I deployed my little website projected built node,js, and customised, with js, in local development I used database mongodb, in the hosting provider doesn't have the mongodb. They said to connect remotely.
How to connect remotely? I have already a cluster in mongodb atlast web, like connection string:
mongoose
.connect('mongodb+srv://washimulislamData:<password>@mydata.d0jjezh.mongodb.net/signup?retryWrites=true&w=majority')
.then(() => {
console.log(`Connected to MongoDB`);
app.listen(3000, () => {
console.log(`Node API app is running on port 3000`);
});
})
.catch((error) => {
console.log(error);
});
Upvotes: 0
Views: 30
Reputation: 1
Upvotes: 0