From 8953a4d52fdeb168eb616fdb5675481c853b7b9c Mon Sep 17 00:00:00 2001 From: DIYgod Date: Sun, 1 Mar 2020 12:59:04 +0800 Subject: [PATCH] refactor: /rsshub/rss -> /rsshub/routes --- assets/radar-rules-next.js | 2 +- assets/radar-rules.js | 2 +- docs/en/install/README.md | 2 +- docs/en/program-update.md | 2 +- docs/install/README.md | 2 +- docs/program-update.md | 2 +- lib/protected_router.js | 2 +- lib/router.js | 3 ++- lib/routes/rsshub/{rss.js => routes.js} | 0 9 files changed, 9 insertions(+), 8 deletions(-) rename lib/routes/rsshub/{rss.js => routes.js} (100%) diff --git a/assets/radar-rules-next.js b/assets/radar-rules-next.js index ed58e5ef4c7957..f7ebb8be134ae4 100644 --- a/assets/radar-rules-next.js +++ b/assets/radar-rules-next.js @@ -365,7 +365,7 @@ title: '有新路由啦', docs: 'https://docs.rsshub.app/program-update.html#rsshub', source: ['', '/*tpath'], - target: '/rsshub/rss', + target: '/rsshub/routes', }, ], }, diff --git a/assets/radar-rules.js b/assets/radar-rules.js index 4f2695f0b79982..bc5e3bd7abe90d 100644 --- a/assets/radar-rules.js +++ b/assets/radar-rules.js @@ -352,7 +352,7 @@ title: '有新路由啦', docs: 'https://docs.rsshub.app/program-update.html#rsshub', source: ['', '/*tpath'], - target: '/rsshub/rss', + target: '/rsshub/routes', }, ], }, diff --git a/docs/en/install/README.md b/docs/en/install/README.md index 68db2dd427c8f9..4a2da5599fb8dd 100644 --- a/docs/en/install/README.md +++ b/docs/en/install/README.md @@ -296,7 +296,7 @@ Partial routes have a strict anti-crawler policy, and can be configured to use p Routes in `protected_route.js` will be protected using HTTP Basic Authentication. -When adding feeds using RSS readers with HTTP Basic Authentication support, authentication information is required, eg:http://usernam3:passw0rd@localhost:1200/protected/rsshub/rss. +When adding feeds using RSS readers with HTTP Basic Authentication support, authentication information is required, eg:http://usernam3:passw0rd@localhost:1200/protected/rsshub/routes. `HTTP_BASIC_AUTH_NAME`: Http basic authentication username, default to `usernam3`, please change asap diff --git a/docs/en/program-update.md b/docs/en/program-update.md index 298165d9ca4138..54d17aecda0383 100644 --- a/docs/en/program-update.md +++ b/docs/en/program-update.md @@ -147,7 +147,7 @@ Refer to [#minecraft](/en/game.html#minecraft) ### New routes - + ## sketch.com diff --git a/docs/install/README.md b/docs/install/README.md index 26c33510671fc9..a0b7b279e7ed29 100644 --- a/docs/install/README.md +++ b/docs/install/README.md @@ -300,7 +300,7 @@ RSSHub 支持 `memory` 和 `redis` 两种缓存方式 `protected_route.js` 内的路由将启用 HTTP Basic Authentication 认证 -支持该认证协议的阅读器,在添加源地址时,需要在源地址前添加认证信息,例如:http://usernam3:passw0rd@127.0.0.1:1200/protected/rsshub/rss +支持该认证协议的阅读器,在添加源地址时,需要在源地址前添加认证信息,例如:http://usernam3:passw0rd@127.0.0.1:1200/protected/rsshub/routes `HTTP_BASIC_AUTH_NAME`: Http basic authentication 用户名,默认为 `usernam3`,请务必修改 diff --git a/docs/program-update.md b/docs/program-update.md index c8d9339b7b7a24..d8ecac1b910c8a 100644 --- a/docs/program-update.md +++ b/docs/program-update.md @@ -168,7 +168,7 @@ pageClass: routes ### 有新路由啦 - + ## sketch.com diff --git a/lib/protected_router.js b/lib/protected_router.js index e9662bef6e4d0f..8d112177f28c30 100644 --- a/lib/protected_router.js +++ b/lib/protected_router.js @@ -6,6 +6,6 @@ const config = require('./config').value; router.use('/(.*)', auth(config.authentication)); // RSSHub -router.get('/rsshub/rss', require('./routes/rsshub/rss')); +router.get('/rsshub/routes', require('./routes/rsshub/routes')); module.exports = router; diff --git a/lib/router.js b/lib/router.js index f64355269bc10c..2de65d10553b89 100644 --- a/lib/router.js +++ b/lib/router.js @@ -25,7 +25,8 @@ router.get('/', require('./routes/index')); router.get('/test/:id', require('./routes/test')); // RSSHub -router.get('/rsshub/rss', require('./routes/rsshub/rss')); +router.get('/rsshub/rss', require('./routes/rsshub/routes')); // 弃用 +router.get('/rsshub/routes', require('./routes/rsshub/routes')); // 1draw router.get('/1draw/', require('./routes/1draw/index')); diff --git a/lib/routes/rsshub/rss.js b/lib/routes/rsshub/routes.js similarity index 100% rename from lib/routes/rsshub/rss.js rename to lib/routes/rsshub/routes.js