thrashing on the routes a bit

This commit is contained in:
Michael Q Larson
2014-10-18 00:46:30 -07:00
parent 58761e7c2b
commit 5dbbb935a5
5 changed files with 44 additions and 5 deletions

35
controllers/challenge.js Normal file
View File

@ -0,0 +1,35 @@
/**
* GET /
* Home page.
*/
var Challenge = require('./../models/Challenge')
exports.index = function(req, res) {
Challenge.find(function(err, challenges){
res.render('challenge/index', {
title: 'Challenges',
challenges: challenges
});
});
};
exports.view = function(req, res) {
Challenge.findById(req.param.id, function(err, challenge){
res.render('challenge/view', {
title: 'Challenge',
challenge: challenge
});
});
};
exports.firstPairProgrammingSession = function(req, res) {
Challenge.findOne({ name: "Start Your First Pair Programming Session" }).exec (function(err, challenge) {
res.render('challenge/first_pair_programming_session', {
title: 'Challenge',
challenge: challenge
});
});
};
//firstPairProgrammingSession
//firstCodePen
//firstDynamicWebsite
//firstWebsite