plugins: filter:server.create_routes - allow plugins to add custom templates and/or modify individual blocks withiin a template

This commit is contained in:
psychobunny
2013-12-30 16:19:59 -05:00
parent fbb4998999
commit 42d77080f3

View File

@@ -807,7 +807,8 @@ var path = require('path'),
var custom_routes = {
'routes': [],
'api': []
'api': [],
'templates': []
};
plugins.ready(function() {
@@ -843,6 +844,17 @@ var path = require('path'),
}
}
var templateRoutes = custom_routes.templates;
for (var route in templateRoutes) {
if (templateRoutes.hasOwnProperty(route)) {
(function(route) {
app.get('/templates/' + templateRoutes[route].template, function(req, res) {
res.send(templateRoutes[route].content);
});
}(route));
}
}
});
});