mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-06 22:15:48 +01:00
fixed #393 - refactored basic route handling, moved some other routes to debug routes
This commit is contained in:
@@ -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');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user