Created
September 23, 2012 21:55
-
-
Save evenchange4/3773179 to your computer and use it in GitHub Desktop.
Revisions
-
evenchange4 revised this gist
Sep 24, 2012 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ # Deploy a [Express.js project](http://myfirstexpress.herokuapp.com/) on Heroku Step by step from command line by Michael Hsu ## Quick start -
evenchange4 revised this gist
Sep 23, 2012 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,7 +6,7 @@ by Michael Hsu ``` $ express myfirstexpress && cd myfirstexpress ``` ### Declare dependencies with NPM `/package.json` ``` # /package.json { @@ -31,7 +31,7 @@ $ express myfirstexpress && cd myfirstexpress $ sudo npm install -l ```` ### Declare process types with `Procfile` ``` # create '/Procfile' web: node app.js -
evenchange4 revised this gist
Sep 23, 2012 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ # Deploy a Express.js project on Heroku Step by step from command line by Michael Hsu ## Quick start -
evenchange4 revised this gist
Sep 23, 2012 . No changes.There are no files selected for viewing
-
evenchange4 revised this gist
Sep 23, 2012 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ Step by step from command line by Michael Hsu ## Quick start ### Create a [Node.js](http://nodejs.org/) web framework '[express](http://expressjs.com/)' ``` $ express myfirstexpress && cd myfirstexpress ``` -
evenchange4 revised this gist
Sep 23, 2012 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -68,7 +68,7 @@ web.1: up for 10s # Open ``` $ heroku open http://myfirstexpress.herokuapp.com/ ``` ## Reference [Getting Started with Node.js on Heroku](https://devcenter.heroku.com/articles/nodejs#listing-and-scaling-dynos) -
evenchange4 revised this gist
Sep 23, 2012 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -67,7 +67,8 @@ web.1: up for 10s ``` # Open ``` $ heroku open [http://myfirstexpress.herokuapp.com/](http://myfirstexpress.herokuapp.com/) ``` ## Reference [Getting Started with Node.js on Heroku](https://devcenter.heroku.com/articles/nodejs#listing-and-scaling-dynos) -
evenchange4 revised this gist
Sep 23, 2012 . 1 changed file with 1 addition and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -67,8 +67,7 @@ web.1: up for 10s ``` # Open ``` $ [heroku open](http://myfirstexpress.herokuapp.com/) ``` ## Reference [Getting Started with Node.js on Heroku](https://devcenter.heroku.com/articles/nodejs#listing-and-scaling-dynos) -
evenchange4 revised this gist
Sep 23, 2012 . 1 changed file with 6 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -65,5 +65,10 @@ $ heroku ps === web: `node app.js` web.1: up for 10s ``` # Open ``` $ heroku open http://myfirstexpress.herokuapp.com/ ``` ## Reference [Getting Started with Node.js on Heroku](https://devcenter.heroku.com/articles/nodejs#listing-and-scaling-dynos) -
evenchange4 revised this gist
Sep 23, 2012 . No changes.There are no files selected for viewing
-
evenchange4 renamed this gist
Sep 23, 2012 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
evenchange4 renamed this gist
Sep 23, 2012 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
evenchange4 created this gist
Sep 23, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,69 @@ # Deploy a Node.js project on Heroku Step by step from command line by Michael Hsu ## Quick start ### Create a Node.js web framework 'express' ``` $ express myfirstexpress && cd myfirstexpress ``` ### Declare dependencies with NPM ``` # /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" } } ``` ### Install your dependencies (-l 處理相依性) ``` $ sudo npm install -l ```` ### Declare process types with Procfile ``` # create '/Procfile' web: node app.js # test start $ foreman start ``` ### Git ``` $ git init $ git add . $ git commit -m "init" ``` ### Create Heroku app ``` $ heroku create myfirstexpress ``` ### Deploy on Heroku ``` $ git push heroku master ``` ### Run server ``` $ 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 ``` ## Reference [Getting Started with Node.js on Heroku](https://devcenter.heroku.com/articles/nodejs#listing-and-scaling-dynos)