Skip to content

Instantly share code, notes, and snippets.

@gokman
Created March 27, 2017 07:52
Show Gist options
  • Select an option

  • Save gokman/0b955bcf75287d5af3bdbf36e4e591d6 to your computer and use it in GitHub Desktop.

Select an option

Save gokman/0b955bcf75287d5af3bdbf36e4e591d6 to your computer and use it in GitHub Desktop.
angular heroku deploy
1. set package.json file:
a. be careful about having dependencies attribute not devDependencies
b. add scripts attribute as below:
"scripts": {
"start": "gulp webserver", //used for starting web server
"postinstall": "node_modules/bower/bin/bower install", //used for installing bower dependencies
}
c. add engines attribute as below:
"engines": {
"node": "4.2.6", //declare node version
"npm": "3.5.x" //declare npm version
}
2. for webserver which you use set host, port values. webserver settings sample below:
gulp.task('webserver', function () {
gulp
.src('src')
.pipe(webserver({host:'0.0.0.0',
path: '/',
port: process.env.PORT || 5000,
fallback: 'index.html',
https: false})
)
});
3. create Procfile (process file for heroku). it is used for how to start app
web: node node_modules/gulp/bin/gulp webserver
4. after settings deploy to heroku
heroku create <app_name>
git add .
git commit -m "..."
git push heroku master
5. finally open application
heroku open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment