Hi, are there any updated instructions for deploying the vidly backend to heroku. mlabs.com is now cloud.mongodb.com and they have different connection methodology to the instructions in the Mastering React course. I was able to deploy the front end but it can’t see the backend. Also i need some instruction on how to populate the cloud database with data.
Thank you.
Loved the course. Looking forward to React Native next. Is there a module on how to handle forgotten passwords in React?
Creating production DB on mongodb.com
I wrote this for helping someone else, but I hope it will help you as well. In case you have trouble, make sure you haven’t made a mistake in the earlier steps. Otherwise you can reply to me with relevant details.
- For creating a MongoDB cluster, you can refer to this video which explains it really well - How To Set A Free Cluster On MongoDB Atlas - YouTube
- Now you need the connection URL (which will be used by the server to connect to the database). This video explains (from 5:43 to 6:25) how you can get it - https://youtu.be/uMVHDbTOIvk?t=343
- In the connection URL (that you got in the previous step), replace with the database user’s password (which was added at 3:18 in How To Set A Free Cluster On MongoDB Atlas - YouTube) and replace myFirstDatabase or with whatever DB name you’d like to have (e.g. vidly-app).
- Now save this connection URL somewhere, and do not share it with anyone.
For populating data to the production DB:
- replace the value against the “db” in the default.json with your production connection URL
- run seed.js.
1 Like
Thanks so much for taking the time to answer. I will try this as soon as i finish the React Native course i’m currently working through.
Cheers
Matthew