Answer the question
In order to leave comments, you need to log in
All requests come with a 503 Service Unavailable code, what's the matter?
In local mode, the requests all work, as I connected to Mongo Atlas, all the time all requests with the code 503 Service Unavailable. There is a connection.
One of the requests
router.get('/list/data', function(req, res, next){
dbLink.getListGuest(req.body.array)
.then((data)=>{
res.set('Content-Type', 'application/json')
.status(200)
.json(data);
})
.catch((err)=>{ res.status(400).send(err); })
});
mongoose.Promise = global.Promise;
mongoose.connect(connectionsString).
then(() => console.log('OK')).
catch((err) => console.log('Error:' + err));
Answer the question
In order to leave comments, you need to log in
Related question Connecting Heroku App to Atlas MongoDB Cloud service
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question