Created
October 6, 2010 21:01
-
-
Save kadirpekel/614080 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var meryl = require('meryl'), | |
connect = require('connect'), | |
merylex = require('meryl-extras'), | |
eco = require('eco'), | |
http = require('http'); | |
var generictemplate = merylex('generictemplate'); | |
http.createServer( | |
meryl | |
.plug(connect.logger()) | |
.plug(connect.staticProvider()) | |
.plug(generictemplate({templateExt: 'eco', renderFunc: eco.render})) | |
.handle('GET /({page}.html)?', function(req, resp) { | |
resp.render('home', {people: ['beaker', 'animal', 'kermit'], | |
page: req.params.page}); | |
}) | |
.cgi() | |
).listen(3000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note that the usage of Connect framework, method chaining, verbose method names, optional path variable sample and generic template from meryl-extras.