I have developed a nodeJS application using Angular as the front-end (used MEAN stack and plan to use Bootstrap with it) and when I try to deploy it to Heroku, whenever I run this line: heroku addons:create mongolab I get the following output:
bruno@bruno-HP-epicsauce:~/herokuFinalApp$ heroku addons:create mongolab
! Please verify your account to install this add-on plan (please enter a credit card) For more information, see https://devcenter.heroku.com/categories/billing Verify now at https://heroku.com/verify
bruno@bruno-HP-epicsauce:~/herokuFinalApp$
And in both sites (mongolab and Heroku) it says it's free... I have already defined the heroku env variable called MONGOLAB_URI, like this:
bruno@bruno-HP-epicsauce:~/herokuFinalApp$ heroku config:set MONGOLAB_URI=mongodb://USER:[email protected]:41643/dbNAME
Setting config vars and restarting rocky-sea-9859... done, v4
MONGOLAB_URI: mongodb://USER:[email protected]:41643/dbNAME
bruno@bruno-HP-epicsauce:~/herokuFinalApp$ heroku config | grep MONGOLAB_URIMONGOLAB_URI: mongodb://USER:[email protected]:41643/dbNAME
bruno@bruno-HP-epicsauce:~/herokuFinalApp$
It still doesnt work...
In the git repository I have the following file structure:
The app is listening on the port: process.env.PORT instead of some local one and the package.json file contains the correct dependencies as it was automatically generated with npm init.
Inside the procfile I have the usual reference to the file that contains my server side code:
web: node server.js
The app.js contains the Angular client-side code.
Is there any 100% free way of deploying an app in Heroku with a DB hosted somewhere?
You have two options to use MongoLab services on Heroku:
Since you have set up MONGOLAB_URI, I assume you created a separate account with MongoLab and created a new MongoDB deployment. In this case you don't need an addon. If you have your MongoDB driver configured to use the connection URI, setting MONGOLAB_URI config on Heroku is usually enough. More info on this here
Heroku asks for a credit card for verification purposes. It won't charge you unless you choose paid addons.
You must verify your account if you want to: Add any add-on to your app, even if the add-on is free. The only exceptions to this are the free plans for the Heroku Postgres and Heroku Connect add-ons, which can be added without verification (source)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With