[node.js] 설치 및 서버 개발하면서 느낀점
1. 실행환경 구축 - node.js 설치
$ brew install node
2. Eclipse ide 환경 구축 - nodeclipse 설치
http://www.nodeclipse.org/ 레퍼런스
(update site - http://dl.bintray.com/nodeclipse/nodeclipse/0.8.0/)
3. 서버 설치 - nodemon 설치
npm install -g nodemon
$ nodemon server.js
13 Dec 21:05:22 - [nodemon] starting `node server.js`
Server Strat! Listen 3000
13 Dec 21:05:34 - [nodemon] restarting due to changes...
13 Dec 21:05:34 - [nodemon] /development/work/wysnode/route/api.js
4. mysql 쪽 client 설치
참조 - https://github.com/felixge/node-mysql
$ npm install felixge/node-mysql
5. 개발환경
(예전 브라우져에서는 alert를 이용하거나 기껏해야 jquery로 개발하던 환경이었는데.. chrome 브라우져 쓰니. 확실히 좋아진 듯 함)
chrome의 개발자 도구를 이용해서. 다양하게 테스트가 가능.
- nodejs 코드에서 console.log 의 값 확인할 수 있음.
- chrome의 개발자 도구에서 list of map을 console.table로 확인가능, console.log 바로 사용 가능
https://developers.google.com/chrome-developer-tools/docs/tips-and-tricks
좋은 프레임웍이 많음. 갖다 쓰면 됨.
6. 개발하고 있는 거
- UI (crud) + mysql db query
- 현재 사용하고 있는 프레임웍은
nodejs + express + backbone 으로 사용.. java 느낌내면서 쓸 수 있다는 큰 장점.
느낀점 : node.js는 async 기능(callback)이 상당히 좋았고, rest (restful) 구현이 상당히 쉬웠다.
게다가 json 구현이 이렇게 쉽다니.. 자바에 비하면 정말 편한듯.. 왜. node.js가 사람들이 왜 열광하는지 느꼈음.
(자바는 정말 json 구현이 다양하게 만들때 좀 귀찮은 일이 많다.)
admin 용으로 충분히 쓸만한 듯