Files
RSSHub/protected_router.js
Henry Wang 54d07cb85c Add http basic authentication (#584)
* Add http basic authentication

closes #560

* Add docs

* Add http basic authentication middleware

* Minor update

* Move settings to config.js
2018-08-31 10:46:17 +08:00

12 lines
290 B
JavaScript
Executable File

const Router = require('koa-router');
const router = new Router();
const auth = require('koa-basic-auth');
const config = require('./config');
router.use('/(.*)', auth(config.authentication));
// RSSHub
router.get('/rsshub/rss', require('./routes/rsshub/rss'));
module.exports = router;