ThalKod / discord-clone

A "Discord clone" with Socket.io, Node.js & MongoDB... Create channel, invite other people to your channel, chat with everyone...
MIT License
152 stars 81 forks source link

Database connection using password #196

Open Krakenied opened 5 years ago

Krakenied commented 5 years ago

How to connect mongodb using username, password, host and database name?

ThalKod commented 5 years ago

The Standard URI Scheme is mongodb://[username:password@]host1[:port1][,host2[:port2],...[,hostN[:portN]]][/[database][?options]] By example you can use: mongodb://username:password@abc.com/

Krakenied commented 5 years ago

What should I do if my database is on another server? Error: listen EPERM 0.0.0.0:5000 at Object.exports._errnoException (util.js:1020:11) at exports._exceptionWithHostPort (util.js:1043:20) at Server._listen2 (net.js:1258:19) at listen (net.js:1307:10) at Server.listen (net.js:1403:5) at mongoose.connect.then (/xxx/public_nodejs/app.js:38:16) at process._tickCallback (internal/process/next_tick.js:109:7)