Not sure what to input for process.envMONGODB_URI ||



While following a tutorial they came onto this little piece of code.

mongodb = process.env.MONGODB_URI || ‘mongodb://localhost:27017’;

Only problem is it won’t connect when I put that code in. I know cloud9 isn’t localhost but what would you put in that spot? I tried putting the project url in preview but that didn’t connect as well.

#2 would be my guess…


Try using process.env.IP and process.env.PORT, maybe? These are variables set by Cloud9, and are open IPs and ports.