node
yum install g++ curl libssl-dev apa
wget http://nodejs.org/dist/v0.6.14/node-v0.6.14.tar.gz
./configure
make
make install
./configure --prefix=/usr/local/node
hellowowrld.js
console.log('hello world');
node helloworld
require()
module.exports
[root@db02 src]# npm install nodemon -g
npm http GET https://registry.npmjs.org/nodemon
npm http 200 https://registry.npmjs.org/nodemon
npm http GET https://registry.npmjs.org/nodemon/-/nodemon-0.6.12.tgz
npm http 200 https://registry.npmjs.org/nodemon/-/nodemon-0.6.12.tgz
/usr/local/bin/nodemon -> /usr/local/lib/node_modules/nodemon/nodemon.js
nodemon@0.6.12 /usr/local/lib/node_modules/nodemon
[root@db02 src]# npm search twitter
익스프레스
expressjs.com
npm install -g express
npm install express jade
[root@db02 simpleweb]# pwd
/data/chapter-06/simpleweb
node app.js
nowjs
NowJS is a Node.js module. The client javascript (now.js) is served by the NowJS server.
NowJS 의 비밀은 두 개의 마술 주머니에서 비롯됩니다. 바로 now 와 everyone.now 입니다. now 객체는 클라이언트와 서버 사이에서 공유되는 마술 주머니입니다. 클라이언트는 now 객체에 변수와 함수들을 자유롭게 넣을 수 있고, 서버 또한 자유롭게 그것들에 접근할 수 있습니다. 물론 반대로도 가능합니다.
서버는 한 번에 수많은 클라이언트 연결을 가질 수 있습니다. 이는 바꿔 말하면 한 번에 수많은 마술주머니를 관리해야 한다는 뜻입니다. 그것이 바로 everyone.now 라는 또다른 마술 주머니를 서버가 가지고 있는 이유입니다. 서버가 everyone.now 에 어떤 변수를 추가하거나 변경하게 되면 모든 클라이언트 각각의 now 가 함께 변경됩니다.
설치
npm install -g now
간단한 테스트.
[root@db02 data]# node /data/node_modules/now/examples/helloworld_example/helloworld_server.js
아래의 내용을 보면 더 좋다.
http://nowjs.com/guide
체팅 예제.
https://github.com/downloads/Flotype/now/chat-example.tgz
Calipso
http://calip.so/quickstart-install-calipso.html
https://github.com/cliftonc/calipso
nowjs-chat
https://github.com/liamcurry/nowjs-chat
nodeChat
https://github.com/ztaccardi/nodeChat