MongoDB, Node.js And You: PART II

903 views
775 views

Published on

This is the second of a three-part series on MongoDB and Node.js at jsDay in Verona Italy 2014.

Published in: Technology, Design
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
903
On SlideShare
0
From Embeds
0
Number of Embeds
12
Actions
Shares
0
Downloads
24
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

MongoDB, Node.js And You: PART II

  1. 1. Node.js, MongoDB and You: Part II Mitch Pirtle jsDay 2014, Verona Italy - @jsdayit
  2. 2. How many of you watched the first talk?
  3. 3. Ok how many of you are new to Node?
  4. 4. What language do you mainly work with?
  5. 5. Now about me.
  6. 6. Mitch Pirtle • Recovering Joomla! founder • Mongo Master • Starting companies since 1995 • Musician, skate punk, football coach • American idiot living in Turin
  7. 7. Ok my Javascript totally sucks.
  8. 8. About this talk.
  9. 9. Ok, technically there are three talks today.
  10. 10. • Session 1: All about MongoDB (you missed it) • Session 2: All about Node.js (right now)! • Session 3: The coolness of both together (next)
  11. 11. Introducing:
  12. 12. Big Node.js things • Completely javascript based. • Asynchronous. • Crazy, whack-daddy fast. • You gotta learn javascript anyway.
  13. 13. More Node.js things • Express is the most common framework • Many others to choose from • Excellent from an operational perspective • Great build tools for css and assets
  14. 14. What do you mean, operational perspective?
  15. 15. TO THE CONSOLE
  16. 16. Ok so what does it look like?
  17. 17. Most simple example var http = require('http'); http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('Hello Worldn'); }).listen(1337, '127.0.0.1'); console.log('Server running at http://127.0.0.1:1337/');
  18. 18. This one repeats what it hears var net = require('net'); ! var server = net.createServer(function (socket) { socket.write('Echo serverrn'); socket.pipe(socket); }); ! server.listen(1337, '127.0.0.1');
  19. 19. TO THE CONSOLE
  20. 20. But wait, there’s more.
  21. 21. Many frameworks and stacks to choose from • Express - the most common framework for Node • MEAN.js - MongoDB, Express, AngularJS and Node • ng-kickstarter - Better hooks for developers (SASS, Zurb, Grunt, API proxy, and more)
  22. 22. MOAR CONSOLE
  23. 23. Now for the pain.
  24. 24. Asynchronous • Well that was not intuitive. • You spend a lot of time making asynchronous code act like a synchronous application. • You’re doin’ it RONG.
  25. 25. Remember: You have to master the asynchronous nature of javascript.
  26. 26. There’s plenty of docs! • …from eight months ago • …that are no longer functional • …and probably didn’t work very well back then • Today’s blog post is tomorrow’s broken example • When stack overflow is your go-to resource, there’s a problem
  27. 27. Stump the Geek™
  28. 28. Thanks! • AboutMe • @mitchitized - Twitter • spacemonkey - GitHub • LinkedIn - I’M AVAILABLE!

×