Skip to content

Commit 18659d1

Browse files
committed
feat: Node.js 环境下 API / 路由不自动跳转到 sub-store.vercel.app
1 parent 1d12dc5 commit 18659d1

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

backend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sub-store",
3-
"version": "2.19.41",
3+
"version": "2.19.42",
44
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.",
55
"main": "src/main.js",
66
"scripts": {

backend/src/restful/miscs.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,17 @@ export default function register($app) {
4949
success(res);
5050
});
5151

52-
// Redirect sub.store to vercel webpage
53-
$app.get('/', async (req, res) => {
54-
// 302 redirect
55-
res.set('location', 'https://sub-store.vercel.app/').status(302).end();
56-
});
52+
if (ENV().isNode) {
53+
$app.get('/', getEnv);
54+
} else {
55+
// Redirect sub.store to vercel webpage
56+
$app.get('/', async (req, res) => {
57+
// 302 redirect
58+
res.set('location', 'https://sub-store.vercel.app/')
59+
.status(302)
60+
.end();
61+
});
62+
}
5763

5864
// handle preflight request for QX
5965
if (ENV().isQX) {

0 commit comments

Comments
 (0)