1文捶、cd到項(xiàng)目目標(biāo)文件夾荷逞,輸入 heroku login使用已注冊(cè)的heroku賬號(hào)進(jìn)行登錄,注意防火墻設(shè)置粹排,如果請(qǐng)求失敗的話种远,修改防火墻設(shè)置,執(zhí)行:
$ export HTTP_PROXY=http://proxt.server.com:portnumber 或者
$ export HTTP_PROXY=https://proxt.server.com:portnumber
2顽耳、$ git clone https://github.com/heroku/node-js-getting-started.git
3坠敷、$ cd node-js-getting-started
4、$ npm install
5射富、$ npm start
6膝迎、修改Procfile中的內(nèi)容,將其指向主頁(yè)index.js(要求index.js與Procfile目錄相同)胰耗,修改為web:node index.js
7限次、$ heroku create 項(xiàng)目名稱,沒(méi)有項(xiàng)目名稱的話會(huì)默認(rèn)分配一個(gè)柴灯,跟別人重復(fù)的話也會(huì)創(chuàng)建失敗
8卖漫、由于這是一個(gè)新的項(xiàng)目,整個(gè)文件都是clone下來(lái)的弛槐,經(jīng)過(guò)上面的修改之后懊亡,執(zhí)行:
$ git add.
$ git commit -m "更新內(nèi)容"
9、$ git push heroku master乎串,將更新推送到git庫(kù)店枣,同時(shí)更新站點(diǎn)的代碼
10速警、$ heroku ps:scale web=1,測(cè)試站點(diǎn)是否running
11鸯两、heroku open闷旧,測(cè)試修改成果