Deploy a Express.js project on Heroku
Step by step from command line by Michael Hsu
$ express myfirstexpress && cd myfirstexpress
# /package.json
{
"name": "application-name",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node app"
},
"dependencies": {
"express": "3.0.0rc4",
"jade": "*"
},
"engines": {
"node": "0.8.x",
"npm": "1.1.x"
}
}
$ sudo npm install -l
# create '/Procfile'
web: node app.js
# test start
$ foreman start
$ git init
$ git add .
$ git commit -m "init"
$ heroku create myfirstexpress
$ git push heroku master
$ heroku ps:scale web=1
Scaling web processes... done, now running 1
# check server
$ heroku ps
=== web: `node app.js`
web.1: up for 10s
$ heroku open
http://myfirstexpress.herokuapp.com/
Thank you.