mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-09-01 14:57:14 +08:00
0792f7ba25
- lazy load - rate limit per path - init .debug.json support - docs - maintainer - radar
18 lines
426 B
JavaScript
18 lines
426 B
JavaScript
const Router = require('@koa/router');
|
|
const config = require('@/config').value;
|
|
const router = new Router();
|
|
|
|
// Load Core Route
|
|
router.get('/', require('./routes/index'));
|
|
|
|
router.get('/robots.txt', (ctx) => {
|
|
if (config.disallowRobot) {
|
|
ctx.set('Content-Type', 'text/plain');
|
|
ctx.body = 'User-agent: *\nDisallow: /';
|
|
} else {
|
|
ctx.throw(404, 'Not Found');
|
|
}
|
|
});
|
|
|
|
module.exports = router;
|