mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-08 22:19:40 +08:00
test: middleware/parameter
This commit is contained in:
@@ -87,23 +87,20 @@ router.get('/', async (ctx) => {
|
||||
});
|
||||
|
||||
router.get('/test/:id', (ctx) => {
|
||||
const item = [];
|
||||
for (let i = 1; i < 6; i++) {
|
||||
item.push({
|
||||
title: `Title${i}`,
|
||||
description: `Item${i}`,
|
||||
pubDate: new Date(`2018-4-${i}`).toUTCString(),
|
||||
link: `https://github.com/DIYgod/RSSHub/issues/${i}`,
|
||||
author: `DIYgod${i}`,
|
||||
});
|
||||
}
|
||||
ctx.state.data = {
|
||||
title: `Test ${ctx.params.id}`,
|
||||
link: 'https://github.com/DIYgod/RSSHub',
|
||||
item: [
|
||||
{
|
||||
title: 'Title1',
|
||||
description: 'Item1',
|
||||
pubDate: new Date('2018-4-2').toUTCString(),
|
||||
link: 'https://github.com/DIYgod/RSSHub/issues/1',
|
||||
},
|
||||
{
|
||||
title: 'Title2',
|
||||
description: 'Item2',
|
||||
pubDate: new Date('2018-4-10').toUTCString(),
|
||||
link: 'https://github.com/DIYgod/RSSHub/issues/2',
|
||||
},
|
||||
],
|
||||
item: item,
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user