標註模式ui
var http = require('http'); var server = http.createServer(); server.on('request', function (req, res) { res.end('Hello World') }) server.listen(3000, function () { console.log('server is running...') })
簡寫模式spa
var http = require('http'); http.createServer(function (req, res) { res.end('Hello World') }).listen(3000, function () { console.log('server is running...') })