Skip to content

Node.js based forum software built for the modern web

use req.app.render

barisusakli0614957542f7
diff --git a/src/controllers/sitemap.js b/src/controllers/sitemap.js
index eee344fc92..8ba41ede77 100644
--- a/src/controllers/sitemap.js
+++ b/src/controllers/sitemap.js
@@ -9,8 +9,8 @@ sitemapController.render = function(req, res, next) {
if (err) {
return next(err);
}
- var Controllers = require('./index');
- Controllers.render('sitemap', tplData, function(err, xml) {
+
+ req.app.render('sitemap', tplData, function(err, xml) {
if (err) {
return next(err);
}
diff --git a/src/routes/index.js b/src/routes/index.js
index b4248120c9..659f4132ae 100644
--- a/src/routes/index.js
+++ b/src/routes/index.js
@@ -103,9 +103,6 @@ module.exports = function(app, middleware, hotswapIds) {
pluginRouter.render = function() {
app.render.apply(app, arguments);
};
- controllers.render = function() {
- app.render.apply(app, arguments);
- };
// Set-up for hotswapping (when NodeBB reloads)
pluginRouter.hotswapId = 'plugins';