วันเสาร์ที่ 14 เมษายน พ.ศ. 2561

hello nodejs

ได้หาและทำตาม tutorial online โดย ยึดตาม website w3school ในส่วนที่เป็น nodejs (https://www.w3schools.com/nodejs/default.asp)

โดยทำตามไล่ตามลำดับดังภาพ



เช่น เป็น 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);
Run example »
แสดงคำบน command line

Example

console.log('This example is different!');
console.log('The result is displayed in the Command Line Interface');
Run example »

และอื่นๆตาม website ข้างต้น

ไม่มีความคิดเห็น:

แสดงความคิดเห็น