diff --git a/examples/ejs/index.js b/examples/ejs/index.js index 13a80efc19..b868bdd7cb 100644 --- a/examples/ejs/index.js +++ b/examples/ejs/index.js @@ -24,6 +24,10 @@ app.engine('.html', require('ejs').__express); app.set('views', path.join(__dirname, 'views')); +// Path to our public directory + +app.use(express.static(path.join(__dirname + 'public'))); + // Without this you would need to // supply the extension to res.render() // ex: res.render('users.html'). diff --git a/examples/jade/public/stylesheets/style.css b/examples/ejs/public/stylesheets/style.css similarity index 100% rename from examples/jade/public/stylesheets/style.css rename to examples/ejs/public/stylesheets/style.css diff --git a/examples/ejs/views/header.html b/examples/ejs/views/header.html index 8dbeb8d3c0..4396bc444f 100644 --- a/examples/ejs/views/header.html +++ b/examples/ejs/views/header.html @@ -2,12 +2,7 @@ - <%= title %> - + <%= title %> + diff --git a/examples/jade/index.js b/examples/jade/index.js deleted file mode 100644 index 86ca14c426..0000000000 --- a/examples/jade/index.js +++ /dev/null @@ -1,52 +0,0 @@ -/** - * Module dependencies. - */ - -var express = require('../../lib/express'); -var path = require('path'); - -// Path to our public directory - -var pub = path.join(__dirname, 'public'); - -// setup middleware - -var app = express(); -app.use(express.static(pub)); - -// Optional since express defaults to CWD/views - -app.set('views', path.join(__dirname, 'views')); - -// Set our default template engine to "jade" -// which prevents the need for extensions -// (although you can still mix and match) -app.set('view engine', 'jade'); - -function User(name, email) { - this.name = name; - this.email = email; -} - -// Dummy users -var users = [ - new User('tj', 'tj@vision-media.ca') - , new User('ciaran', 'ciaranj@gmail.com') - , new User('aaron', 'aaron.heckmann+github@gmail.com') -]; - -app.get('/', function(req, res){ - res.render('users', { users: users }); -}); - -// change this to a better error handler in your code -// sending stacktrace to users in production is not good -app.use(function(err, req, res, next) { - res.send(err.stack); -}); - -/* istanbul ignore next */ -if (!module.parent) { - app.listen(3000); - console.log('Express started on port 3000'); -} diff --git a/examples/jade/views/header.jade b/examples/jade/views/header.jade deleted file mode 100644 index 6c42929d83..0000000000 --- a/examples/jade/views/header.jade +++ /dev/null @@ -1,3 +0,0 @@ -head - title Jade Example - link(rel="stylesheet", href="/stylesheets/style.css") \ No newline at end of file diff --git a/examples/jade/views/layout.jade b/examples/jade/views/layout.jade deleted file mode 100644 index 300cdc7847..0000000000 --- a/examples/jade/views/layout.jade +++ /dev/null @@ -1,5 +0,0 @@ -doctype html -html - include header - body - block content diff --git a/examples/jade/views/users/index.jade b/examples/jade/views/users/index.jade deleted file mode 100644 index feb7623fa3..0000000000 --- a/examples/jade/views/users/index.jade +++ /dev/null @@ -1,8 +0,0 @@ - -extends ../layout - -block content - h1 Users - #users - for user in users - include user \ No newline at end of file diff --git a/examples/jade/views/users/user.jade b/examples/jade/views/users/user.jade deleted file mode 100644 index 9e603298cb..0000000000 --- a/examples/jade/views/users/user.jade +++ /dev/null @@ -1,3 +0,0 @@ -.user - h2= user.name - .email= user.email \ No newline at end of file