Files
freeCodeCamp/controllers/challenge.js

49 lines
1.5 KiB
JavaScript
Raw Normal View History

2014-10-18 00:46:30 -07:00
/**
2014-10-20 12:37:48 -07:00
* GET /
* Home page.
*/
2014-10-18 00:46:30 -07:00
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
});
});
};
2014-10-20 12:37:48 -07:00
exports.createAndDeployAWebsite = function(req, res) {
res.render('challenge/create-and-deploy-a-website', {
name: 'Create and Deploy a Website',
image: 'http://startbootstrap.com/assets/img/templates/landing-page.jpg',
video: '',
directions: "In the next 5 minutes, you'll create a website and deploy it to the internet!",
links: ["http://startbootstrap.com/template-overviews/freelancer/", "www.bitballoon.com", "https://atom.io/"]
});
};
exports.addDynamicContentToYourWebsite = function(req, res) {
res.render('challenge/add-dynamic-content-to-your-website', {
name: 'Add dynamic content to your website'
2014-10-18 00:46:30 -07:00
});
};
2014-10-20 12:37:48 -07:00
exports.experimentWithHtmlAndCssInCodepen = function(req, res) {
res.render('challenge/experiment-with-html-and-css-in-codepen', {
name: 'Experiment with HTML and CSS in Codepen'
});
};
exports.startAPairProgrammingSession = function(req, res) {
res.render('challenge/start-a-pair-programming-session', {
name: 'Start a pair programming session'
});
};