I have a NestJS application that I have just deployed using Vercel.
Using Node 16+, MongoDB 4.12.1, Mongoose 6.8.0
For some reason, all my requests are getting a timeout after 10 sec (which is the maximum for Vercel’s free tier).
Following my investigation, I didn’t got any timeout for endpoints that are not calling MongoDB, so I assume that this is the problem.
When I am running my application locally, it works like a charm, even using the vercel-admin-user credentials.
I have done the following for the integration:
- Integrated MongoDB Atlas with Vercel following their guide: link
- Created a vercel-admin-user with read and write access in MongoDB cluster
- Allowed all network access to my cluster (0.0.0.0 & the exact Vercel IP address)
2
Answers
go to the mongodb account. then go to the database access. here you will see the new user called vercel-admin-user. then edit the user and set new password for it. then go to your project souce code change the mongodb pass & user in uri.
Make sure:
MONGODB_URI
.