Friday, 6 March 2015

Angularjs fullstack project with codeship and heroku

After yo generating this project can work locally. (of couse you need run a mongodb locally at the same time, as this project need a mongodb.)

But you will have issues to host it on heroku.

Solution

change the gruntfilejs, add:

grunt.registerTask('heroku', 'build');

add Procfile and add:

web: node dist/server/app.js

change package.json file. (the easiest way is copy all dev dependencies into prod section)

of cause you need setup a mongodb on heroku and set heroku env for it.

To run it locally, you just need run:

grunt serve

but please be aware that, heroku use:

node dist/server/app.js

Heroku env:

BUILDPACK_URL = https://github.com/jakeorr/heroku-buildpack-nodejs-grunt-compass-bower-configurable.git 

MONGOLAB_URI = mongodb://xxx:xxx@xxxx.mongolab.com:xxx/xxxx 

NODE_ENV = production

No comments:

Post a comment