fixed #393 - refactored basic route handling, moved some other routes to debug routes

This commit is contained in:
Julian Lam
2013-11-11 14:06:26 -05:00
parent 9bea23bbfe
commit 37497fc5a0
3 changed files with 57 additions and 57 deletions

View File

@@ -1,5 +1,35 @@
var DebugRoute = function(app) {
app.namespace('/debug', function() {
app.get('/cid/:cid', function (req, res) {
categories.getCategoryData(req.params.cid, function (err, data) {
if (data) {
res.send(data);
} else {
res.send(404, "Category doesn't exist!");
}
});
});
app.get('/tid/:tid', function (req, res) {
topics.getTopicData(req.params.tid, function (data) {
if (data) {
res.send(data);
} else {
res.send(404, "Topic doesn't exist!");
}
});
});
app.get('/pid/:pid', function (req, res) {
posts.getPostData(req.params.pid, function (data) {
if (data) {
res.send(data);
} else {
res.send(404, "Post doesn't exist!");
}
});
});
app.get('/prune', function(req, res) {
var Notifications = require('../notifications');