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

v1.18.x
psychobunny 11 years ago
parent fbb4998999
commit 42d77080f3

@ -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));
}
}
});
});

Loading…
Cancel
Save