This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.d8888b. 888 888 d888 888888888 .d8888b. d8b 888 | |
d88P Y88b 888 888 d8888 888 d88P Y88b Y8P 888 | |
888 888 888 888 888 888 888 888 888 | |
888 88888b. 8888b. 88888b. 888888 .d88b. 888d888 888 8888888b. 888 888 .d8888b 888888 .d8888b | |
888 888 "88b "88b 888 "88b 888 d8P Y8b 888P" 888 "Y88b 888 88888 888 88K 888 88K | |
888 888 888 888 .d888888 888 888 888 88888888 888 888 888 888888 888 888 888 "Y8888b. 888 "Y8888b. | |
Y88b d88P 888 888 888 888 888 d88P Y88b. Y8b. 888 888 Y88b d88P Y88b d88P 888 X88 Y88b. X88 | |
"Y8888P" 888 888 "Y888888 8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.d8888b. 888 888 d888 d8888 .d8888b. d8b 888 | |
d88P Y88b 888 888 d8888 d8P888 d88P Y88b Y8P 888 | |
888 888 888 888 888 d8P 888 888 888 888 | |
888 88888b. 8888b. 88888b. 888888 .d88b. 888d888 888 d8P 888 888 888 .d8888b 888888 .d8888b | |
888 888 "88b "88b 888 "88b 888 d8P Y8b 888P" 888 d88 888 888 88888 888 88K 888 88K | |
888 888 888 888 .d888888 888 888 888 88888888 888 888 8888888888 888888 888 888 888 "Y8888b. 888 "Y8888b. | |
Y88b d88P 888 888 888 888 888 d88P Y88b. Y8b. 888 888 888 Y88b d88P 888 X88 Y88b. X88 | |
"Y8888P" 888 888 "Y888888 8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
browseTutorials: function(req, res) { | |
Tutorial.count().exec(function (err, numberOfTutorials){ | |
if (err) return res.negotiate(err); | |
if (!numberOfTutorials) return res.notFound(); | |
Tutorial.find({ | |
limit: 10, | |
skip: req.param('skip') | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
profileFollower: function(req, res) { | |
User.findOne({ | |
username: req.param('username') | |
}) | |
.populate("followers") | |
.populate("following") | |
.populate("tutorials") | |
.exec(function (err, foundUser){ | |
if (err) return res.negotiate(err); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
updateVideo: function(req, res) { | |
/* | |
__ __ _ _ _ _ _ | |
\ \ / /_ _| (_)__| |__ _| |_(_)___ _ _ | |
\ V / _` | | / _` / _` | _| / _ \ ' \ | |
\_/\__,_|_|_\__,_\__,_|\__|_\___/_||_| | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
editVideo: function(req, res) { | |
Tutorial.findOne({ | |
id: +req.param('tutorialId') | |
}) | |
.populate('videos') | |
.populate('owner') | |
.populate('ratings') | |
.exec(function(err, foundTutorial){ | |
if (err) return res.negotiate(err); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.d8888b. 888 888 d888 .d8888b. .d8888b. d8b 888 | |
d88P Y88b 888 888 d8888 d88P Y88b d88P Y88b Y8P 888 | |
888 888 888 888 888 .d88P 888 888 888 | |
888 88888b. 8888b. 88888b. 888888 .d88b. 888d888 888 8888" 888 888 .d8888b 888888 .d8888b | |
888 888 "88b "88b 888 "88b 888 d8P Y8b 888P" 888 "Y8b. 888 88888 888 88K 888 88K | |
888 888 888 888 .d888888 888 888 888 88888888 888 888 888 888 888888 888 888 888 "Y8888b. 888 "Y8888b. | |
Y88b d88P 888 888 888 888 888 d88P Y88b. Y8b. 888 888 Y88b d88P Y88b d88P 888 X88 Y88b. X88 | |
"Y8888P" 888 888 "Y888888 8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.d8888b. 888 888 d888 .d8888b. .d8888b. d8b 888 | |
d88P Y88b 888 888 d8888 d88P Y88b d88P Y88b Y8P 888 | |
888 888 888 888 888 888 888 888 888 | |
888 88888b. 8888b. 88888b. 888888 .d88b. 888d888 888 .d88P 888 888 .d8888b 888888 .d8888b | |
888 888 "88b "88b 888 "88b 888 d8P Y8b 888P" 888 .od888P" 888 88888 888 88K 888 88K | |
888 888 888 888 .d888888 888 888 888 88888888 888 888 d88P" 888888 888 888 888 "Y8888b. 888 "Y8888b. | |
Y88b d88P 888 888 888 888 888 d88P Y88b. Y8b. 888 888 888" Y88b d88P 888 X88 Y88b. X88 | |
"Y8888P" 888 888 "Y8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.d8888b. 888 888 d888 d888 .d8888b. d8b 888 | |
d88P Y88b 888 888 d8888 d8888 d88P Y88b Y8P 888 | |
888 888 888 888 888 888 888 888 888 | |
888 88888b. 8888b. 88888b. 888888 .d88b. 888d888 888 888 888 888 .d8888b 888888 .d8888b | |
888 888 "88b "88b 888 "88b 888 d8P Y8b 888P" 888 888 888 88888 888 88K 888 88K | |
888 888 888 888 .d888888 888 888 888 88888888 888 888 888 888888 888 888 888 "Y8888b. 888 "Y8888b. | |
Y88b d88P 888 888 888 888 888 d88P Y88b. Y8b. 888 888 888 Y88b d88P 888 X88 Y88b. X88 | |
"Y8888P" 888 888 "Y888888 88888P" "Y888 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 404 (Not Found) Handler | |
* | |
* Usage: | |
* return res.notFound(); | |
* return res.notFound(err); | |
* return res.notFound(err, 'some/specific/notfound/view'); | |
* | |
* e.g.: | |
* ``` |
NewerOlder