Indawo yasimahla yeNode.js ibamba noHeroku

Ukusingathwa kweNode.js akukasasazeki kakhulu, ngakumbi kumazwe athetha isiJamani. Inkampani yamafu yaseMelika uHeroku ibonelela ngoncedo apha-kwaye simahla . Uhlala uqaphela iparadigm "Yakha ii -apps ... hayi iziseko zophuhliso" kwaye akunangxaki. Njengomzekelo, siphumeza umsebenzi omncinci wekhron ngokusekwe kwiPhantomJS , eqhekeza iwebhusayithi yonke imihla kwaye ithumele isihloko sephepha nge-imeyile.


Ukwenza oku, siqala ukubhalisa simahla apha https://signup.heroku.com/:

Indawo yasimahla yeNode.js ibamba noHeroku

Emva kwesiqinisekiso esinyanzelekileyo se-imeyile, siya kukhupha iphasiwedi ekhuselekileyo:

Indawo yasimahla yeNode.js ibamba noHeroku

Ukuze sikwazi ukusebenzisa izongezo zasimahla ezivela kwindawo yentengiso kamva, kufuneka siqale siqinisekise iakhawunti yethu phantsi kwe- https://heroku.com/verify ngokufaka ikhadi lekhredithi (ungakhathazeki, yonke into ihlala isimahla):

Indawo yasimahla yeNode.js ibamba noHeroku

Zonke ezinye izinto zenzeka ngoku kuphela kwilayini yomyalelo. Ngale nto sifuna apha ekhaya Node.js / npm , Git kunye neHeroku CLI .

Indawo yasimahla yeNode.js ibamba noHeroku

Ekugqibeleni singena kuHeroku kwalapha ekhaya (kwakanye) kwilayini yomyalelo:

Indawo yasimahla yeNode.js ibamba noHeroku

Kuqala senza iapps entsha esekwe kwindawo efanelekileyo yokwakha . Kumzekelo wethu sisebenzisa indawo esemthethweni yeNode.:

1a01abaf4b9308c5714622396ccc4708

Ngoku sidala iphakheji.json ukufaka iPhomomJS , iCasperJS , iSpookyJS kunye neepakeji zeNodemailer ezifunekayo kwiprojekthi yethu.:

1a01abaf4b9308c5714622396ccc4708

Ingqondo yokwenyani inokufumaneka kwiscript.js:

1a01abaf4b9308c5714622396ccc4708

Siqala ngokuvavanya yonke into ekuhlaleni:

1a01abaf4b9308c5714622396ccc4708

Iskripthi sikhupha isihloko kwiwebhusayithi kwaye sithumela i-imeyile:

Indawo yasimahla yeNode.js ibamba noHeroku

Ngoku sityhala yonke into kuHeroku, ekwabangela ukuba inkqubo yokwakha:

1a01abaf4b9308c5714622396ccc4708

Ukuba ufuna ukutyhala utshintsho lwekhowudi kuHeroku kamva, tyhala kwakhona. Kwelinye icala, ngoku sinokusebenzisa i-SSH ukujonga ukuba yonke into isebenza kwiseva:

1a01abaf4b9308c5714622396ccc4708

Nalapha, i-imeyile ithunyelwe ngokuchanekileyo. Ngoku kufuneka sisebenzise inkqubo ngokuzenzekelayo:

1a01abaf4b9308c5714622396ccc4708

Songeza umnxeba weskripthi omtsha ngo "Yongeza umsebenzi omtsha":

Indawo yasimahla yeNode.js ibamba noHeroku

Njengovavanyo, sikhetha yonke imizuzu eli-10 njengobuninzi kwaye siyigcine:

Indawo yasimahla yeNode.js ibamba noHeroku

I-cronjob ngoku iya kwenza umsebenzi wayo ngokuzenzekelayo kwikamva.

Emva