test: test route for response test

This commit is contained in:
DIYgod
2019-01-17 16:00:56 +08:00
parent 83a1e4a574
commit e12a67310f
8 changed files with 83 additions and 70 deletions
+22
View File
@@ -86,6 +86,28 @@ router.get('/', async (ctx) => {
});
});
router.get('/test', (ctx) => {
ctx.state.data = {
title: 'DIYgod',
link: 'https://diygod.me/',
description: '测试路由 Test route',
item: [
{
title: 'Title1',
description: 'Item1',
pubDate: new Date('2018-4-2').toUTCString(),
link: 'https://diygod.me/1',
},
{
title: 'Title2',
description: 'Item2',
pubDate: new Date('2018-4-10').toUTCString(),
link: 'https://diygod.me/2',
},
],
};
});
// RSSHub
router.get('/rsshub/rss', require('./routes/rsshub/rss'));