MongoDB, Node.js And You: PART II

  • 355 views
Uploaded on

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

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

More in: Technology , Design
  • 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
355
On Slideshare
0
From Embeds
0
Number of Embeds
1

Actions

Shares
Downloads
11
Comments
0
Likes
1

Embeds 0

No embeds

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. Node.js, MongoDB and You: Part II Mitch Pirtle jsDay 2014, Verona Italy - @jsdayit
  • 2. How many of you watched the first talk?
  • 3. Ok how many of you are new to Node?
  • 4. What language do you mainly work with?
  • 5. Now about me.
  • 6. Mitch Pirtle • Recovering Joomla! founder • Mongo Master • Starting companies since 1995 • Musician, skate punk, football coach • American idiot living in Turin
  • 7. Ok my Javascript totally sucks.
  • 8. About this talk.
  • 9. Ok, technically there are three talks today.
  • 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. Introducing:
  • 12. Big Node.js things • Completely javascript based. • Asynchronous. • Crazy, whack-daddy fast. • You gotta learn javascript anyway.
  • 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. What do you mean, operational perspective?
  • 15. TO THE CONSOLE
  • 16. Ok so what does it look like?
  • 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. 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. TO THE CONSOLE
  • 20. But wait, there’s more.
  • 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. MOAR CONSOLE
  • 23. Now for the pain.
  • 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. Remember: You have to master the asynchronous nature of javascript.
  • 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. Stump the Geek™
  • 28. Thanks! • AboutMe • @mitchitized - Twitter • spacemonkey - GitHub • LinkedIn - I’M AVAILABLE!