Skip to content

Instantly share code, notes, and snippets.

@vdurmont
Created November 7, 2013 20:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vdurmont/7361496 to your computer and use it in GitHub Desktop.
Save vdurmont/7361496 to your computer and use it in GitHub Desktop.
var express = require('express');
var app = express();
// Jade
app.set('views', __dirname+'/views');
app.set('view engine', 'jade');
app.get('/', function(req, res){
var name = req.query.name;
if (name == null)
res.render('world', {
title: "MyApp for the world",
date: new Date()
});
else
res.render('user', {
title: "MyApp for the you",
name: name,
reversedName: name.split("").reverse().join("")
});
});
app.listen(3333);
console.log('Running on port 3333!');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment