블로그 이미지
너덜

calendar

1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31

Notice

Tag

'dev/node.js'에 해당되는 글 1

  1. 2012.04.04 node 설치 및 nowjs 로 쳇팅 바로 테스트해보기.
2012. 4. 4. 16:47 dev/node.js

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.

http://nowjs.com/

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://localhost:8080/


아래의 내용을 보면 더 좋다.
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

 

posted by 너덜
prev 1 next