mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 03:26:04 +01:00
closed #536
This commit is contained in:
@@ -318,7 +318,7 @@ var path = require('path'),
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
translator.translate(templates.logout.toString(), function(parsedTemplate) {
|
||||
templates.logout = parsedTemplate;
|
||||
});
|
||||
@@ -649,6 +649,32 @@ var path = require('path'),
|
||||
"Sitemap: " + nconf.get('url') + "sitemap.xml");
|
||||
});
|
||||
|
||||
app.get('/recent.rss', function(req, res) {
|
||||
var rssPath = path.join(__dirname, '../', 'feeds/recent.rss'),
|
||||
loadFeed = function () {
|
||||
fs.readFile(rssPath, function (err, data) {
|
||||
if (err) {
|
||||
res.type('text').send(404, "Unable to locate an rss feed at this location.");
|
||||
} else {
|
||||
res.type('xml').set('Content-Length', data.length).send(data);
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
if (!fs.existsSync(rssPath)) {
|
||||
feed.updaterecent(function (err) {
|
||||
if (err) {
|
||||
res.redirect('/404');
|
||||
} else {
|
||||
loadFeed();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
loadFeed();
|
||||
}
|
||||
});
|
||||
|
||||
app.get('/recent/:term?', function (req, res) {
|
||||
// TODO consolidate with /recent route as well -> that can be combined into this area. See "Basic Routes" near top.
|
||||
app.build_header({
|
||||
|
||||
Reference in New Issue
Block a user