โดยทำตามไล่ตามลำดับดังภาพ
เช่น เป็น server localhost ที่ port 8080 โดย response คำว่า 'Hello World!'
Example
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World!');
}).listen(8080);
แสดงคำบน command line
Example
console.log('This example is different!');
console.log('The result is displayed in the Command Line Interface');
และอื่นๆตาม website ข้างต้น
ไม่มีความคิดเห็น:
แสดงความคิดเห็น