nodeGame on Heroku - nodeGame/nodegame GitHub Wiki

Important! Heroku's infrastructure is designed to keep your instance alive for about 24hours, after which it will be killed and restarted on another host. However, there is no guarantee that the restarting will not happen earlier. When the app is restarted, both the file system and the memory are cleared and cannot be recovered. You should take this account in the development of your game, or use another provider that is always on, such as Digital Ocean.

Instructions

  1. First, install the heroku CLI tools & create an account.

  2. Clone the nodegame-heroku repository.

    git clone git://github.com/nodeGame/nodegame-heroku.git
    cd nodegame-heroku
    
  3. Replace the default ultimatum game inside the games/ folder with the game of your own. Important! If you adding a git repository make sure to add it as submodule:

    git submodule add https://github.com/user/mygame games/mygame
    
  4. Make sure to be at the top level of your nodegame-heroku repository.

  5. Add your changes to the git index.

    git add -u
    git commit -m 'added my game'
    
  6. Run heroku create, which prepares Heroku to receive the code.

    heroku create
    
  7. Push your code to heroku.

    git push heroku
    
  8. Ensure that at least one instance of your Heroku app is running.

    heroku ps:scale web=1
    
  9. Visit your app (might need to adjust the full uri).

    heroku open 
    
  10. If somethings goes wrong, you can look at the logs:

    heroku logs
    

Updating the instance

If your game/s installed as submodule/s got updated, you need to pull each of them manually:

cd games/mygame
git pull

Then, commit changes and push to Heroku:

git add -u
git commit -m "games updated"
git push heroku
⚠️ **GitHub.com Fallback** ⚠️