How to test the node.js + mongodb application that works in Heroku locally?

I know how to run a regular node.js application locally using foreman , but when my application is connected to Heroku's MongoHQ base, the connection is part of the heroku environment.

Is there a way to test the application on my local machine?

+4
source share
2 answers

Foreman will load the environment variables specified in your application's .env file. It is located in the Local setup section of Vars Dev Center Configuration and Settings . There's a plugin for the Herobu toolbelt tool, which allows you to pull the configuration from your running application, if that is what you want to use (you can also consider launching the MongoDB server locally):

 $ heroku plugins:install git://github.com/ddollar/heroku-config.git $ heroku config:pull --overwrite --interactive 
+3
source

Have you tried installing foreman on your local computer? Take a look at Procfile and see what processes it manages. There is probably nothing special about connecting the Heroku machine to MongoHQ. Just use grep for mongohq in the project and you will probably find some configuration to connect to the database.

0
source

All Articles