-
Notifications
You must be signed in to change notification settings - Fork 2
Installation on Heroku
This is a quick tutorial how to get your own coops-demo instance running on Heroku.
Before you start make sure you have Heroku account (https://signup.heroku.com/signup/dc) and have installed Toolbelt (https://toolbelt.heroku.com/)
-
Go into your Heroku Dashboard (https://dashboard.heroku.com/apps)
-
Click on the “Create a new app” -link.
-
Choose name and region for the application
in example we use coops-demo as application name
-
Clone the git repository on your local computer
git clone [email protected]:coops-demo.git -o heroku
-
Navigate into the cloned Git -repository
cd coops-demo
-
Login to heroku
heroku login
-
Add mongodb addon (mongosoup, mongohq or mongolab)
heroku addons:add mongosoup:test
-
Enable WebSockets (see https://devcenter.heroku.com/articles/heroku-labs-websockets for details)
heroku labs:enable websockets
-
Fix canvas build on Heroku (see https://github.com/LearnBoost/node-canvas/wiki/Installation-on-Heroku for details)
heroku config:add BUILDPACK_URL=https://github.com/mojodna/heroku-buildpack-multi.git#build-env cat << EOF > .buildpacks https://github.com/mojodna/heroku-buildpack-cairo.git https://github.com/heroku/heroku-buildpack-nodejs.git EOF git add .buildpacks git commit -m "node-canvas on Heroku"
-
Add CoOps Demo code
git remote add coops-demo [email protected]:foyt/coops-demo.git git pull [email protected]:foyt/coops-demo.git
-
Check mongo url
heroku config
-
Register Application into GitHub, Google and Facebook for OAuth (https://github.com/settings/applications/new, https://code.google.com/apis/console/, https://developers.facebook.com/)
Callback urls must be in following format: http://myapp.herokuapp.com/auth/github/callback (replace myapp.herokuapp.com with your own urlname)
-
Add settings.json into git folder with following content (replace mongo url, ws host and auth clientIds and clientSecrets with your own):
{ "mongo": { "url": "mongodb://replace:mongo/url" }, "http": { "host": "0.0.0.0", "port": "$ENV" }, "ws": { "host": "coops-demo.herokuapp.com", "port": "80" }, "auth": { "facebook": { "clientId": "[facebook client id]", "clientSecret": "[facebook client secet]" }, "google": { "clientId": "[google client id]", "clientSecret": "[google client secet]" }, "github": { "clientId": "[github client id]", "clientSecret": "[github client secet]" } }, "sessionSecret": "keyboard cat" }
-
Add settings.json into git
git add -f settings.json git commit -m "Added settings.json"
-
Push code into Heroku
git push
-
Navigate into your application and you should see the CoOps demo.