The Complete Node.js Course

買了Mosh的這堂課來看,要來把它學一學。

【Node Module System】
.Node.js的modularity特性好用,每個module裡面的變數名子不會影響到別的module。
.require function會吃到export裡的東西 ( it will store the result in a variable )
.介紹了一下jshint工具,發現我的IDE有欸,不過要去settings裡面打開。
.Modular 解釋Node.js如何達成封裝機制
【Event】
一個很重要的概念。
In Node, we have a class called http that we can use to build a web server.
So we listen on a given port, and every time we receive a request on that port, that http class raises an event.
(類似總機,轉接客人的電話)
Now our job is to respond to that event which basically involves reading that request and returning the right response.
(就像有客服投訴,要回對的安緩句子一樣…)

Continue reading The Complete Node.js Course