You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the website is using a local MongoDB instance (localhost:27017) for development. However, when deploying the website, this local database is not accessible.
Description
To allow the deployed version to retrieve data correctly, we need to:
Set up a cloud MongoDB database (MongoDB Atlas).
Modify .env files for production
Ensure Vercel has the correct MongoDB URI configured.
Tasks
Set Up MongoDB Atlas
Set up a Free Shared Cluster
Create a New Database
Create a Database User (set a username and password)
Allow Access from any IP (we can restrict this later)
Copy the MongoDB Connection String.
Update .env.production file
Add the MongoDB Atlas URI. Do not commit .env.production to Github (add it to .gitignore). Since this file may contain sensitive information like secrets.
Add MongoDB URI to Vercel Environment Variables and Deploy
Deploy and Test
Test the API in Production, such as whether or not you can send POST and GET requests.
Resources
The text was updated successfully, but these errors were encountered:
Purpose
Currently, the website is using a local MongoDB instance (localhost:27017) for development. However, when deploying the website, this local database is not accessible.
Description
To allow the deployed version to retrieve data correctly, we need to:
Tasks
Resources
The text was updated successfully, but these errors were encountered: