Files
RSSHub/lib/v2/aqara/router.js
T
Ethan Shen 36cf4c3b4c fix(route): Aqara News (#12921)
* fix(route): Aqara News

* feat(route): add Aqara category & tag

* fix: crlf to lf

* fix broken images

* fix url

---------
2023-08-17 00:16:30 +08:00

16 lines
524 B
JavaScript

module.exports = function (router) {
router.get('/cn/news', require('./news'));
router.get('/community/:id?/:keyword?', require('./community'));
router.get('/:region/:type?', (ctx) => {
const types = {
news: 'press-release',
blog: 'article',
};
const { region = 'en', type = 'news' } = ctx.params;
const redirectTo = `/aqara/${region}/category/${types[type]}`;
ctx.redirect(redirectTo);
});
router.get(/([\w-/]+)?/, require('./post'));
};