Skip to content

Instantly share code, notes, and snippets.

@chentsulin
Last active October 15, 2015 13:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chentsulin/b400f703837ce0f8b944 to your computer and use it in GitHub Desktop.
Save chentsulin/b400f703837ce0f8b944 to your computer and use it in GitHub Desktop.
Week 4 - After class

Week 4

Next Week Pre-reading

node & npm

CommonJS Module
安裝 node (附帶 npm)

使用 Windows 而非 OS X 或 Linux 的同學建議安裝 Cygwin,可以有比較接近 Linux 的開發體驗

確定能成功執行 Hello World
var http = require('http');

http.createServer(function (req, res) {
  res.writeHead(200, {'Content-Type': 'text/plain'});
  res.end('Hello World\n');
}).listen(1337, "127.0.0.1");

console.log('Server running at http://127.0.0.1:1337/');

Promise

fetch

須先看上面的 promise

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment