Skip to content

Commit

Permalink
add better theme, delete button and compelet template
Browse files Browse the repository at this point in the history
  • Loading branch information
Azat Mardanov committed Oct 2, 2013
1 parent b868048 commit 5feaddd
Show file tree
Hide file tree
Showing 53 changed files with 9,391 additions and 395 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -0,0 +1 @@
node_modules
13 changes: 12 additions & 1 deletion app.js
Expand Up @@ -37,10 +37,21 @@ app.use(app.router);
if ('development' == app.get('env')) {
app.use(express.errorHandler());
}

app.param('task_id', function(req, res, next, taskId) {
console.log (taskId);
req.db.tasks.findById(taskId, function(error, task){
if (error) return next(error);
if (!task) return next(new Error('Task is not found.'));
req.task = task;
return next();
});
})
app.get('/', routes.index);
app.get('/tasks', tasks.list);
app.post('/tasks', tasks.add);
app.del('/tasks/:task_id', tasks.del);
app.get('/tasks/completed', tasks.completed);

app.all('*', function(req, res){
res.send(404);
})
Expand Down

0 comments on commit 5feaddd

Please sign in to comment.