mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-21 18:01:36 +03:00
16 lines
469 B
JavaScript
16 lines
469 B
JavaScript
|
var _ = require('lodash'),
|
||
|
rssCache = require('./cache');
|
||
|
|
||
|
module.exports.render = function render(res, baseUrl, data) {
|
||
|
// Format data - this is the same as what Express does
|
||
|
var rssData = _.merge({}, res.locals, data);
|
||
|
|
||
|
// Fetch RSS from the cache
|
||
|
return rssCache
|
||
|
.getXML(baseUrl, rssData)
|
||
|
.then(function then(feedXml) {
|
||
|
res.set('Content-Type', 'text/xml; charset=UTF-8');
|
||
|
res.send(feedXml);
|
||
|
});
|
||
|
};
|