Unable to connect Node app hosted on Heroku with MongoDB Cluster - node.js

i am making NodeJS app hosted on heroku and using MongoDB atlas as a backend.When i am sending POST request to app via POSTMAN it is showing:
Error: 503 service unavailable
In my opinion node app is failed to connect with MongoDB atlas cluster.If so then how can i connect it with MongoDB.
THANKS

See Connecting Heroku App to Atlas MongoDB Cloud service, you need to either connect via SSL or whitelist the relevant Heroku IP address ranges for your app.

Related

Cpanel Nodejs CRUD REST API giving response as "Incomplete response received from application" using Mysql DB

When i create a localhost nodejs CRUD API i am able to make post request.But when i deployed it in cpanel using nodejs software "Incomplete response received from application"
Please share more information as my preliminary guess is that if you are using MongoDB then you cant run it on shared hosting you should use some other DB like Atlas MongoDB or Mlab
I recommend you host it on Heroku as its also free
Deploy APP to Heroku
Use Any thirParty mongoDB service
Test your CRUD API

Connecting AWS Elastic Beanstalk to MongoDB with a connection string

I have deployed a Node.JS REST API to AWS Elastic Beanstalk which fetches data via HTTP requests from a MongoDB database (using just the connection string for that, not atlas or anything).
When I run it locally it works fine, but when I try to use the AWS address and run it from there I'm getting a 504 Gateway Time-out error. I don't know what causes this issue and would appreciate some help!

How to connect my Heroku hosted Node REST services to remote SQL?

Can anyone please tell me about how to connect REST based services on Heroku to a Linux based Remote SQL?
I'm new to hosting REST based services. I've created some REST services via Node.js and Express and I'm trying to connect those services with a remote SQL database on my hosting plan on https://ecowebhosting.co.uk.
But it always shows server closed the connection because it requires an IP address to setup a connection between server and heroku.

DigitalOcean connect node.js to mongodb

I created and deployed a MERN web app on DigitalOcean which works fine using a Mongo database hosted on mlab.com, but now I want to host the database on DigitalOcean and I'm having difficulties with this...
I followed this tutorial https://www.digitalocean.com/community/tutorials/how-to-install-mongodb-on-ubuntu-16-04 but now I don't know how to connect my node.js server to this database.
Does the connection to 127.0.0.1:27017/mydbname should work on production?
Any solution or advice would help me a lot.

mongodb on cloud foundry / appfog

I am deploying nodejs app with mongodb db with collections/data in it. I have it under the data/db directory. it doesn't have username / password. but with the appfog the service has the user name/password. how does the mongodb service know to start with the db I deployed.
Thanks
When you create the MongoDB client you should pass server host/port and authentication information to it.
usually on hosted services such as Heroku or Appfog this info is provided in evncironment variables which can be accessed with process.env.VARIABLE_NAME

Resources