Skip to content

Commit

Permalink
minor changes for pro express.js 💿 🎇
Browse files Browse the repository at this point in the history
  • Loading branch information
azat-co committed Sep 15, 2014
1 parent e863e0a commit 344bd52
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 12 deletions.
2 changes: 0 additions & 2 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ app.use(function(req, res, next) {
next();
})
app.locals.appname = 'Express.js Todo App'
// all environments


app.set('port', process.env.PORT || 3000);
app.set('views', __dirname + '/views');
Expand Down
7 changes: 0 additions & 7 deletions public/stylesheets/main.less
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
* {
font-size:20px;
}
.btn {
// margin-left: 20px;
// margin-right: 20px;
}
.num {
// margin-right: 3px;
}
.item {
height: 44px;
width: 100%;
Expand Down
2 changes: 1 addition & 1 deletion routes/tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ exports.completed = function(req, res, next) {
};

exports.markCompleted = function(req, res, next) {
if (!req.body.completed) return next(new Error('Param is missing'));
if (!req.body.completed) return next(new Error('Param is missing.'));
req.db.tasks.updateById(req.task._id, {$set: {completed: req.body.completed === 'true'}}, function(error, count) {
if (error) return next(error);
if (count !==1) return next(new Error('Something went wrong.'));
Expand Down
4 changes: 2 additions & 2 deletions views/tasks.jade
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ block content
input(type='hidden', value='true', name='all_done')
input(type='hidden', value=locals._csrf, name='_csrf')
input(type='submit', class='btn btn-success btn-xs', value='all done')
form(action="/tasks", method='post')
form(action='/tasks', method='post')
input(type='hidden', value=locals._csrf, name='_csrf')
div.name
input(type="text", name="name", placeholder='Add a new task')
input(type='text', name='name', placeholder='Add a new task')
div.delete
input.btn.btn-primary.btn-sm(type="submit", value='add')
if (tasks.length === 0)
Expand Down

0 comments on commit 344bd52

Please sign in to comment.