Skip to content
Myr

app.js

This file

Path

examples/partials/app.js

32 lines · 772 bytes · JavaScript

Last changed by

Not known.

History of this file

Take it

The walk stopped after 200 commits: lines older than f98c112 point at it.

Added app.render() local precedence testTj Holowaychukbefore adoptionf98c112

lines 1–32why, one step back
1
2/**3 * Module dependencies.4 */56var express = require('../../lib/express');78var app = express.createServer();910// Optional since express defaults to CWD/views1112app.set('views', __dirname + '/views');1314// Set our default template engine to "jade"15// which prevents the need for extensions16// (although you can still mix and match)17app.set('view engine', 'jade');1819// Dummy record20var ninja = {21 name: 'leonardo',22 summary: { email: 'hunter.loftis+github@gmail.com', master: 'splinter', description: 'peaceful leader' },23 weapons: ['katana', 'fists', 'shell'],24 victims: ['shredder', 'brain', 'beebop', 'rocksteady']25};2627app.get('/', function(req, res){28 res.render('ninja', { ninja: ninja });29});3031app.listen(3000);32console.log('Express app started on port 3000');