Skip to content

Commit

Permalink
feat: 分享支持多一级路由指定输出目标
Browse files Browse the repository at this point in the history
  • Loading branch information
xream committed Dec 29, 2024
1 parent ff4be7a commit 8090d67
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sub-store",
"version": "2.15.9",
"version": "2.15.10",
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
"main": "src/main.js",
"scripts": {
Expand Down
10 changes: 10 additions & 0 deletions backend/src/restful/download.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,17 @@ import { getISO } from '@/utils/geo';
import env from '@/utils/env';

export default function register($app) {
$app.get('/share/col/:name/:target', async (req, res) => {
req.query.target = req.params.target;
$.info(`使用路由指定目标: ${req.params.target}`);
await downloadCollection(req, res);
});
$app.get('/share/col/:name', downloadCollection);
$app.get('/share/sub/:name/:target', async (req, res) => {
req.query.target = req.params.target;
$.info(`使用路由指定目标: ${req.params.target}`);
await downloadSubscription(req, res);
});
$app.get('/share/sub/:name', downloadSubscription);

$app.get('/download/collection/:name/:target', async (req, res) => {
Expand Down

0 comments on commit 8090d67

Please sign in to comment.