Skip to content

Instantly share code, notes, and snippets.

@chaosmail
Last active February 8, 2018 23:06
Show Gist options
  • Save chaosmail/195326a2407b869fe459 to your computer and use it in GitHub Desktop.
Save chaosmail/195326a2407b869fe459 to your computer and use it in GitHub Desktop.
Step-by-Step deploying AngularJS-Fullstack-generator to Heroku

Prerequisites

Install Yeoman and AngularJS-Fullstack generator

[http://yeoman.io/] (Yeoman)

npm install -g yo

[https://github.com/DaftMonk/generator-angular-fullstack] (AngularJS-Fullstack on Github)

npm install -g generator-angular-fullstack

Install Heroku toolbelt

[https://toolbelt.heroku.com/] (Heroku Toolbelt)

wget -qO- https://toolbelt.heroku.com/install-ubuntu.sh | sh

Install git-subtree

[http://stackoverflow.com/a/5977494] (Michaël Witrant on Stackoverflow)

git clone git://github.com/apenwarr/git-subtree.git
cd git-subtree
sudo sh install.sh

Setup the App

Scaffold the App

// Use AngularJS-Fullstack-generator for scaffolding

mkdir my-app
yo angular-fullstack my-app

// Set up git

git init
git add .
git commit -m "Ready to deploy"

Create the Heroku app

// Create Heroku app

heroku create

// Add MongoDB (free plan)

heroku addons:add mongohq:sandbox

// Enable Websocket support (if needed)

heroku labs:enable websockets

// Set Node Environment

heroku config:set NODE_ENV=production

This requires credit card details for your Heroku account.

Or Link an existing app

// Set the remote

heroku git:remote -a my-app
@FfejW
Copy link

FfejW commented Feb 8, 2018

Is it possible to deploy to two heroku apps from one repository? Just switching the remote doesn't seem to do the trick.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment