rss.js
668 Bytes
/**
* 逛rss订阅
* @author: chenfeng<feng.chen@yoho.cn>
* @date: 2016/09/13
*/
'use strict';
const mRoot = '../models';
const rssModel = require(`${mRoot}/rss`);
const helpers = global.yoho.helpers;
/**
* [订阅逛最新的资讯]
*/
const index = (req, res, next) => {
let gender = req.query.gender || '1,2,3',
items = [];
res.setHeader('Content-Type', 'text/xml; charset=utf-8');
return rssModel.getRssArticle(gender).then((result) => {
return res.render('rss/index', {
layout: false,
time: (new Date()).toUTCString(),
items: result
});
});
};
module.exports = {
index
};