Introducción a express
View Slide
Dan Zajdband
@dzajdband
zajdband.com.ar
los-rayos.com.ar
La filosofía de node
“Node.js has a relatively small core set of functionality. Thegeneral guideline is that node core contains everything that isstrictly necessary to do network programming, and writeuserland modules.”@izs - node.js maintainer, npm creator
require(‘http’)
require(‘http’).createServer(function(req, res){res.writeHead(200, {‘Content-Type’: ‘text/plain’});res.end(‘Piojo Lopez\n’);}).listen(3000);
npm install express
• Powered by Connect• Middleware• Routing• HTTP helpers• Liviano• Soporta +14 template engines
npm install -g express
NODE_ENV=development
lluvia de módulos
• Socket.IO (https://github.com/LearnBoost/socket.io)• Passport (https://github.com/jaredhanson/passport)• Mongoose (https://github.com/LearnBoost/mongoose)• Redis (https://github.com/mranney/node_redis)• Superagent (https://github.com/visionmedia/superagent)
• Up (https://github.com/LearnBoost/up)• bcrypt (https://github.com/ncb000gt/node.bcrypt.js/)• Oauth (https://github.com/ciaranj/node-oauth)• nodemailer (https://github.com/andris9/Nodemailer)• Jade (https://github.com/visionmedia/jade)
Bonus track
components
client-side package manager
• Componentes modulares• No solo para javascript• templates• Extensible• Resuelve dependencias• Rápido (mucho más que, por ejemplo, npm)
follow @component_js