Tuesday, May 4th, 2010
Express: Sinatra for Node
-
-
require.paths.unshift('path/to/express/lib')
-
require('express')
-
-
get('/', function(){
-
this.redirect('/hello/world')
-
})
-
-
get('/hello/world', function(){
-
return 'Hello World'
-
})
-
-
get('/bye/world', function(){
-
layout: false,
-
locals: {
-
title: 'Bye World'
-
}
-
})
-
})
-
-
run()
-
In the rush to become either a Rails, or a Sinatra for server side JavaScript, we have Express. Clean and simple. Simple and clean.
Related Content:











sexy!