mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-09-24 23:12:34 +08:00
feat: render export
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import render from '@/utils/render';
|
||||
import { rss3Ums, json, art } from '@/utils/render';
|
||||
import * as path from 'node:path';
|
||||
import { config } from '@/config';
|
||||
import utils from '@/utils/common-utils';
|
||||
@@ -88,12 +88,12 @@ const middleware: MiddlewareHandler = async (ctx, next) => {
|
||||
|
||||
if (outputType === 'ums') {
|
||||
ctx.header('Content-Type', 'application/json; charset=UTF-8');
|
||||
return ctx.body(render.rss3Ums(result));
|
||||
return ctx.body(rss3Ums(result));
|
||||
} else if (outputType === 'json') {
|
||||
ctx.header('Content-Type', 'application/feed+json; charset=UTF-8');
|
||||
return ctx.body(render.json(result));
|
||||
return ctx.body(json(result));
|
||||
} else {
|
||||
return ctx.body(render.art(template, result));
|
||||
return ctx.body(art(template, result));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
+3
-11
@@ -1,11 +1,3 @@
|
||||
import art from 'art-template';
|
||||
import json from '@/views/json';
|
||||
import rss3Ums from '@/views/rss3-ums';
|
||||
|
||||
// We may add more control over it later
|
||||
|
||||
export default {
|
||||
art,
|
||||
json, // This should be used by RSSHub middleware only.
|
||||
rss3Ums,
|
||||
};
|
||||
export { default as rss3Ums } from '@/views/rss3-ums';
|
||||
export { default as json } from '@/views/json';
|
||||
export { default as art } from 'art-template';
|
||||
|
||||
Reference in New Issue
Block a user