- heroku create appname - creates a heroku app with a given name ( if not explicitly stated it's gonna get randomized )
- git remote -v - will show us whether the remote was successfully created for our local repo.
- create a procfile, which describes what types of processes are gonna be launched on Heroku in my case (a web server) the inside of the files were as follows:
web: node name_of_the_node_server_file.js
- Create a package.json file which contains information about the app, especially the packages info, and launching script. In my case it looked like that:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
{ "name": "AppName", "version": "0.0.1", "description": "Description", "main": "name_of_the_server_file.js", "dependencies": { "connect": "x.x.x", "util": "x.x.x" }, "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "start": "node name_of_the_server_file.js" }, "repository": { "type": "git", "url": "https://bitbucket_login@bitbucket.org/bitbucket_login/repo_name.git" }, "author": "Name" }
- We need to add these files and use a standard git commit
- git push heroku master - where heroku is a remote created by "heroku create".
- Now we can open our app on heroku.
- In case of errors we can check the logs from the server through command line:
heroku logs
Helpful links:
Deploying to Heroku with git - https://devcenter.heroku.com/articles/git
Heroku logs - https://devcenter.heroku.com/articles/logging
Procfile types - https://devcenter.heroku.com/articles/procfile
No comments:
Post a Comment