introduction to node.js by vinothini b

8
Introduction to Node.js Vinothini B © Spritle Software Private Limited | http://www.spritle.com

Upload: spritle-software-private-limit-ed

Post on 01-Sep-2014

546 views

Category:

Technology


3 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Introduction to Node.js by Vinothini B

© Spritle Software Private Limited | http://www.spritle.com

Introduction to Node.js

Vinothini B

Page 2: Introduction to Node.js by Vinothini B

© Spritle Software Private Limited | http://www.spritle.com

Agenda

• Introduction• Getting started– Basic Install, Web App (Express, Jade)

• Samples– Sample app in Express– Sample app in Geddy

Page 3: Introduction to Node.js by Vinothini B

© Spritle Software Private Limited | http://www.spritle.com

Introduction - I

• Node.js is a platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications.

• Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.

Page 4: Introduction to Node.js by Vinothini B

© Spritle Software Private Limited | http://www.spritle.com

Introduction - II

• JavaScript everywhere• Files I/O and DB queries are non-blocking • Great performance even while handling a big

number of users• Set of tools and libraries living on top on V8

Page 5: Introduction to Node.js by Vinothini B

© Spritle Software Private Limited | http://www.spritle.com

Bring it to Your Machine

• Install nvm (node version manager)– like rvm in ruby world–nvm install 0.10.8• rvm install ruby 2.0.0

• Use npm to install node packages– like gem in ruby world–npm install –g express• gem install faker

Page 6: Introduction to Node.js by Vinothini B

Spritle Software Private Limited | http://www.spritle.com

WebApp in a Minute

npm install -g expressexpress --sessions vb_songs

create : vb_songscreate : vb_songs/package.jsoncreate : vb_songs/app.jscreate : vb_songs/routescreate : vb_songs/routes/index.jscreate : vb_songs/routes/user.jscreate : vb_songs/viewscreate : vb_songs/views/layout.jadecreate : vb_songs/views/index.jadecreate : vb_songs/public/imagescreate : vb_songs/public/javascriptscreate : vb_songs/publiccreate : vb_songs/public/stylesheetscreate : vb_songs/public/stylesheets/style.css

npm installnode app.js

Page 7: Introduction to Node.js by Vinothini B

© Spritle Software Private Limited | http://www.spritle.com

Code Walk-through with Samples

• vb_songs app – Sample app–package.json

• Like Rails Scaffolding – Sample CRUD–geddy | compound

Page 8: Introduction to Node.js by Vinothini B

http://www.Spritle.comCopyright: Spritle Software Private Limited

Thank you&

Questions