test: middleware/template

This commit is contained in:
DIYgod
2019-01-31 11:45:00 +08:00
parent 5daa65673b
commit 0a62389eaa
6 changed files with 90 additions and 13 deletions

View File

@@ -91,10 +91,19 @@ router.get('/test/:id', (ctx) => {
throw Error('Error test');
}
const item = [];
if (ctx.params.id === 'long') {
item.push({
title: `Long Title `.repeat(10),
description: `Long Description `.repeat(10),
pubDate: new Date(`2018-3-1`).toUTCString(),
link: `https://github.com/DIYgod/RSSHub/issues/0`,
author: `DIYgod0`,
});
}
for (let i = 1; i < 6; i++) {
item.push({
title: `Title${i}`,
description: `Item${i}`,
description: `Description${i}`,
pubDate: new Date(`2018-4-${i}`).toUTCString(),
link: `https://github.com/DIYgod/RSSHub/issues/${i}`,
author: `DIYgod${i}`,