Node ppt
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
4,789
On Slideshare
4,785
From Embeds
4
Number of Embeds
1

Actions

Shares
Downloads
75
Comments
0
Likes
1

Embeds 4

http://slidecastr.heroku.com 4

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Nodejs How To?nodejs.org
  • 2. Where do we use it?● Yahoo Proxy Feed● XML Api● IP2Country Service● IP Spam Cop● Skitto● RTB Serving
  • 3. We Started with an evilvar http = require(http);http.createServer(function (req, res) { res.writeHead(200, {Content-Type: text/plain}); res.end(Hello World );}).listen(1337, 127.0.0.1);console.log(Server running at http://127.0.0.1:1337/);
  • 4. DONT CALL ME A WEBSERVERWhy??Coz I Can even answer what 1+1 is :PIm a platform with event-driven, non-blocking I/O for N/W applicationdevelopmentUsing Node as a Server that responds to HTTP requests is a use case :)
  • 5. ARCHITECTURE
  • 6. LOOP IS MY LIFEI have only one worker [Single Threaded]He runs in an Event Loop ● A Loop over a queue of events to be processed ● Event Loop !== setIntervalHe serves the events via callbacks and Dont dare to block him, thenI will the shift to state of coma ;)
  • 7. AM I ASYNC?Ya people do believe so ;)Scenarios ● I/O ● setInterval ● setTimeout ● process.nextTick
  • 8. Quick Demo
  • 9. Programming in NodePrerequisites ● Deeper understanding of javascript closures and this [We take it for granted :P] ● Nodes async behaviour ● Nodes module system & npm [He is the one :)]
  • 10. Nodejs Module System ● Inherits Common JS module system ● All you require is the cached module.exports object ● You have a lots of options to locate
  • 11. npm● npm !== Node Package Manager [npm is not an acronym (ninaa) - may be ;)]● If maven is for java then npm is for node● npm + package.json + modules The way to write node app :)
  • 12. Is coding asynchronous way hard?We had no choice and we were left in the state below :P
  • 13. Patterns and Antipatterns??PS: All Javascript Patterns and Antipatterns apply ;)
  • 14. Debugging + Monitoring :(Trust us, It is harder than developing an App :)
  • 15. Overview Questions !!!!!!