简体   繁体   中英

How to share my localhost mongodb database (for my MERN app)

For the last 1-2 months I have been building a web app using MERN stack. I am new to web development, but my setup so far is:

Mongo - I have this only locally on my computer.

Node API - When I run my app locally, my node API is served on port 3001.

React - When I run my app locally, my frontend is served on port 3000.

I open up 3 different terminal windows, and run (a) mongod, (b) node index.js, and (c) npm start, to get the database / api / frontend running.

How to Share - I recently pushed my Node API and React Frontend code to github, for a developer friend of mine to fork the repo and help take a look at my code. However, even with the Node API and Front-end code, my friend will not be able to run my app because I my mongodb collections / my db are only local on my computer. How do I share this with him?

Thanks!

您可以将数据转储到文件中,然后将其提交到常规basys中的存储库中,该示例取自此处

mongodump --host mongodb1.example.net --port 3017 --username user --password "pass" --out /opt/backup/mongodump-2013-10-24

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM