Install Node JS

Step 1 : Instalasi

  1. Download Node.js versi terakhir di http://nodejs.org/
    Versi  Node.js yang saya gunakan adalah node-v0.10.25-x64 dengan operating sitem windows 8.1 :)
  2. Install file node.js yang sudah di download tadi

Step 2 : Hello World !

Nah setiap teknologi baru kan biasanya dimulai dengan kata “Hello World!”  nih. Jadi ayo kita coba buat Hello World dengan Node.js :)
Jadi kita akan membuat server HTTP sederhana yang menampilkan pesan itu. Pertama, Anda harus memahami sistem modul Node.js. Pada Node.js, fungsi dirumuskan dalam modul yang harus dimuat agar dapat digunakan. Ada banyak modul yang tercantum dalam dokumentasi Node.js yang bisa dilihat di sini
Sekarang mari kita buat 1 file bernama index.js , lalu isikan kode berikut  :
[js]</pre>
var http = require(‘http’);
http.createServer(function (req, res) {
res.writeHead(200, {‘Content-Type’: ‘text/plain’});
res.end(‘Hello World\n’);
}).listen(8090, ‘127.0.0.1’);
console.log(‘Server running at http://127.0.0.1:8090/’);
<pre>[/js]

kemudian buka browser, karena tadi kita set portnya ialah 8090 , makan buka http://localhost:8090/
dan tampilan yang akan tampil kira-kira seperti ini :
Hello World Node.js
Hello World Node.js
Sekian tutorial saya tentang Node.js .
Tunggu artikel berikutnya :)

COMMENTS

Nama

angular,2,back,5,ci,3,frame,10,front,8,html,3,laravel,3,mysql,3,node,1,postgre,2,react,2,video,3,wp,4,
ltr
item
Ayo Koding: Install Node JS
Install Node JS
http://www.tutorial-webdesign.com/wp-content/uploads/2014/01/Screenshot-2014-01-26-15.57.36-150x150.png
Ayo Koding
https://ayobelajarkoding.blogspot.com/2017/09/step-1-instalasi-download-node.html
https://ayobelajarkoding.blogspot.com/
http://ayobelajarkoding.blogspot.com/
http://ayobelajarkoding.blogspot.com/2017/09/step-1-instalasi-download-node.html
true
1179307111903062524
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS CONTENT IS PREMIUM Please share to unlock Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy