(node:12679) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): MongoNetworkError: failed to connect to server [localhost:27017] on first connect [MongoNetworkError: connect ECONNREFUSED 127.0.0.1:27017]
When I try to follow the shortened link to the website, I get a 504 Gateway Time-out
I’ve double checked variables and connections between mLab and Glitch, but I can’t find my error.
I followed the instructions from this page https://www.freecodecamp.org/challenges/url-shortener-microservice, particularly this section “Pro Tip: Checkout this wiki article for tips on integrating MongoDB on Glitch.” But the wiki article references Heroku, not Glitch. So that’s probably the first mistake, as you mentioned. Either way, I’ve royally messed up my code so much that it doesn’t even work locally now, and I’m going to start over from the beginning. This time I’ll follow the template for Glitch that’s in the beta fcc url shortener. Hopefully I’ll be more successful there. Thanks for taking a look and giving it a try.
I’ve been working with the same issue for the last few day’s.
My problem was in understanding how the promise was dealt with in mongodb. I finally solved it the other night and spent today making sure it wasn’t a fluke. Seem’s to work
This is what they want, I think…