Nodejs web,db,hosting

1,805 views

Published on

Published in: Technology, Design
1 Comment
2 Likes
Statistics
Notes
No Downloads
Views
Total views
1,805
On SlideShare
0
From Embeds
0
Number of Embeds
32
Actions
Shares
0
Downloads
38
Comments
1
Likes
2
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Nodejs web,db,hosting

    1. 1. NODE.JSWEB/DB/HOSTING 허광남 kenu@okjsp.pe.kr
    2. 2. NODE.JS WEB FRAMEWORK http://expressjs.com/
    3. 3. EXPRESS WEB FRAMEWORK• Insanely fast (and small)• server-side JavaScript web development framework• built on • [node](http://nodejs.org) • [Connect](http://github.com/senchalabs/connect)
    4. 4. var app = express.createServer();app.get(/, function(req, res){ res.send(Hello World);});app.listen(3000);
    5. 5. INSTALLnpm install expressnpm install -g express
    6. 6. QUICK START• Create the app: •$ npm install -g express •$ express /tmp/foo && cd /tmp/foo
    7. 7. QUICK START• Install dependencies: •$ npm install -d• Start the server: •$ node app.js
    8. 8. STRUCTURE
    9. 9. FEATURES* Robust routing* Redirection helpers* Dynamic view helpers* Content negotiation* Focus on high performance* View rendering and partials support
    10. 10. FEATURES* Environment based configuration* Session based flash notifications* Built on [Connect](http://github.com/senchalabs/connect)* High test coverage* Executable for generating applications quickly* Application level view options
    11. 11. FEATURES VIA CONNECT* Session support* Cache API* Mime helpers* ETag support* Persistent flash notifications* Cookie support* JSON-RPC* Logging* and _much_ more!
    12. 12. DEMO• express install && run
    13. 13. NODE.JS IN HOSTING http://www.heroku.com
    14. 14. HOSTING PAAS• joyent• heroku• nodester• cloud foundry• node socket• nodejitsu
    15. 15. HOSTING IAAS• Amazon EC2• Rackspace• joyent cloud
    16. 16. HEROKU• http://www.heroku.com/• heroku client• foreman• git
    17. 17. • Windows xp DEMO• http://devcenter.heroku.com/categories/node-js • foreman .net framework v4.0.30319 • http://msdn.microsoft.com/en-us/netframework/ aa569263.aspx
    18. 18. NODE.JS WITH DBhttps://github.com/sidorares/nodejs-mysql-native
    19. 19. MYSQL-NATIVE• npm install mysql-native
    20. 20. nodepad mysqltest.jsvar db = require("mysql-native").createTCPClient();db.auto_prepare = true;function dump_rows(cmd){ cmd.addListener(row, function(r) { console.dir(r); } );}db.auth("nodesample", "nodeuser", "password");dump_rows(db.query("select 1+1,2,3,4,length(hello)"));dump_rows(db.execute("select 1+1,2,3,4,length(?)", ["hello"]));db.close();
    21. 21. • MySql protocol documentation: • http://forge.mysql.com/wiki/ MySQL_Internals_ClientServer_Protocol• Other node.js mysql clients: • http://github.com/felixge/node-mysql • http://github.com/Sannis/node-mysql-libmysqlclient • http://github.com/Guille/node.dbslayer.js
    22. 22. REFERENCES• Node Guide 번역 • http://nodeguide.atelier.weaveus.com/• Node.js 호스팅 • http://inspiredjw.tistory.com/2• Node.js 기술 요약 정리 • http://www.webresourcesdepot.com/the-awesome-node-js-and-its-gang/

    ×