mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-10-30 18:33:08 +08:00
Merge branch 'master' of github.com:DIYgod/RSSHub
This commit is contained in:
+2
-2
@@ -96,13 +96,13 @@ RSSHub 同时支持 RSS 2.0 和 Atom 输出格式,在路由末尾添加 `.rss`
|
||||
|
||||
### debug
|
||||
|
||||
在路由末尾添加 `.debug.json`且实例运行在`debugInfo=true`的情况下,RSShub将会返回插件设置在`ctx.state.json`的内容
|
||||
在路由末尾添加 `.debug.json`且实例运行在`debugInfo=true`的情况下,RSShub 将会返回插件设置在`ctx.state.json`的内容
|
||||
|
||||
这功能皆在方便开发者调试问题,方便用户自行开发需要的功能。插件作者可以酌情考虑使用,没有格式要求。
|
||||
|
||||
举例:
|
||||
|
||||
- `/furstar/characters/cn.debug.json`
|
||||
- `/furstar/characters/cn.debug.json`
|
||||
|
||||
## 输出简讯
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ module.exports = async (ctx, next) => {
|
||||
if (ctx.state.json) {
|
||||
ctx.body = JSON.stringify(ctx.state.json, null, 4);
|
||||
} else {
|
||||
ctx.body = JSON.stringify({ message: "plugin does not set json" });
|
||||
ctx.body = JSON.stringify({ message: 'plugin does not set json' });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ module.exports = async (ctx) => {
|
||||
const details = await Promise.all(info.map((e) => utils.detailPage(e.detailPage, ctx.cache)));
|
||||
|
||||
ctx.state.json = {
|
||||
info
|
||||
info,
|
||||
};
|
||||
|
||||
ctx.state.data = {
|
||||
|
||||
Reference in New Issue
Block a user