mirror of
https://github.com/knightcrawler-stremio/knightcrawler.git
synced 2024-12-20 03:29:51 +00:00
[addon] adds configurable support
This commit is contained in:
@@ -35,6 +35,10 @@ function manifest(config = {}) {
|
||||
idPrefixes: ['tt', 'kitsu'],
|
||||
background: `https://i.ibb.co/VtSfFP9/t8wVwcg.jpg`,
|
||||
logo: `https://i.ibb.co/w4BnkC9/GwxAcDV.png`,
|
||||
behaviorHints: {
|
||||
configurable: true,
|
||||
configurationRequired: false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,13 +16,12 @@ const limiter = rateLimit({
|
||||
router.use(limiter);
|
||||
|
||||
router.get('/', (_, res) => {
|
||||
const landingHTML = landingTemplate(manifest());
|
||||
res.setHeader('content-type', 'text/html');
|
||||
res.end(landingHTML);
|
||||
res.redirect('/configure')
|
||||
res.end();
|
||||
});
|
||||
|
||||
router.get('/:configuration', (req, res) => {
|
||||
const configValues = parseConfiguration(req.params.configuration);
|
||||
router.get('/:configuration?/configure', (req, res) => {
|
||||
const configValues = parseConfiguration(req.params.configuration || '');
|
||||
const landingHTML = landingTemplate(manifest(configValues), configValues);
|
||||
res.setHeader('content-type', 'text/html');
|
||||
res.end(landingHTML);
|
||||
|
||||
Reference in New Issue
Block a user