Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix route-separation example

  • Loading branch information...
commit c2fa6cc94d27d842d407b44a9fdb484421a5bf86 1 parent 4646080
TJ Holowaychuk tj authored
2  examples/route-separation/index.js
View
@@ -13,7 +13,9 @@ var express = require('../..')
app.set('view engine', 'jade');
app.set('views', __dirname + '/views');
+app.use(express.logger('dev'));
app.use(express.cookieParser());
+app.use(express.bodyParser());
app.use(express.methodOverride());
app.use(express.static(__dirname + '/public'));
6 examples/route-separation/post.js
View
@@ -2,9 +2,9 @@
// Fake posts database
var posts = [
- { title: 'Foo', body: 'some foo bar' }
- , { title: 'Foo bar', body: 'more foo bar' }
- , { title: 'Foo bar baz', body: 'more foo bar baz' }
+ { title: 'Foo', body: 'some foo bar' },
+ { title: 'Foo bar', body: 'more foo bar' },
+ { title: 'Foo bar baz', body: 'more foo bar baz' }
];
exports.list = function(req, res){
4 examples/route-separation/public/style.css
View
@@ -11,10 +11,10 @@ a.edit {
opacity: .3;
}
a.edit::before {
- content: '[ ';
+ content: ' [';
}
a.edit::after {
- content: ' ]';
+ content: ']';
}
dt {
font-weight: bold;
12 examples/route-separation/user.js
View
@@ -2,8 +2,8 @@
// Fake user database
var users = [
- { name: 'TJ', email: 'tj@vision-media.ca' }
- , { name: 'Tobi', email: 'tobi@vision-media.ca' }
+ { name: 'TJ', email: 'tj@vision-media.ca' },
+ { name: 'Tobi', email: 'tobi@vision-media.ca' }
];
exports.list = function(req, res){
@@ -22,15 +22,15 @@ exports.load = function(req, res, next){
exports.view = function(req, res){
res.render('users/view', {
- title: 'Viewing user ' + req.user.name
- , user: req.user
+ title: 'Viewing user ' + req.user.name,
+ user: req.user
});
};
exports.edit = function(req, res){
res.render('users/edit', {
- title: 'Editing user ' + req.user.name
- , user: req.user
+ title: 'Editing user ' + req.user.name,
+ user: req.user
});
};
1  examples/route-separation/views/users/edit.jade
View
@@ -1,7 +1,6 @@
extends ../layout
block content
-
h1 Editing #{user.name}
#user
form(method="post")
Please sign in to comment.
Something went wrong with that request. Please try again.