Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Node.js
With WebMatrix
Node.js
“ Built on V8 JavaScript runtime,
Perfect for data-intensive real-time
applications ”

http://nodejs.org/
Express.js
“ Web application framework for node.js ”

http://expressjs.com
Jade
“ Node template Engine ”

http://jade-lang.com/
“a free, lightweight, cloud-connected web development
tool”

http://www.microsoft.com/web/webmatrix/
Start
Routs
routes = require('./routes')
user = require('./routes/user')

app.get('/', routes.index); http://localhost/
app.get(...
Controller
user.js
exports.profile = function(req, res){
res.render('profile',
{
title: 'Profile',
username: req.params.us...
View
profile.jade

extends layout
block content
h1= title
p This is #{username}'s profile
App Source:
https://github.com/agentmilindu/simple-Node.js-app.git

By Milindu Sanoj Kumarage
agentmilindu@gmail.com
@agen...
Upcoming SlideShare
Loading in …5
×

Node.js with WebMatrix

753 views

Published on

Simple introduction to Node.js app building

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Node.js with WebMatrix

  1. 1. Node.js With WebMatrix
  2. 2. Node.js “ Built on V8 JavaScript runtime, Perfect for data-intensive real-time applications ” http://nodejs.org/
  3. 3. Express.js “ Web application framework for node.js ” http://expressjs.com
  4. 4. Jade “ Node template Engine ” http://jade-lang.com/
  5. 5. “a free, lightweight, cloud-connected web development tool” http://www.microsoft.com/web/webmatrix/
  6. 6. Start
  7. 7. Routs routes = require('./routes') user = require('./routes/user') app.get('/', routes.index); http://localhost/ app.get('/users', user.list); http://localhost/users app.get('/users/:user', user.profile); http://localhost/users/bill app.get('/users/:user/pics', user.media); http://localhost/users/bill/pics
  8. 8. Controller user.js exports.profile = function(req, res){ res.render('profile', { title: 'Profile', username: req.params.user } ); }; // get('/users/:user',user.profile)
  9. 9. View profile.jade extends layout block content h1= title p This is #{username}'s profile
  10. 10. App Source: https://github.com/agentmilindu/simple-Node.js-app.git By Milindu Sanoj Kumarage agentmilindu@gmail.com @agentmilindu lk.linkedin.com/in/agentmilindu/

×