feat: Node.js 环境下 API / 路由不自动跳转到 sub-store.vercel.app

This commit is contained in:
xream 2025-05-17 22:49:12 +08:00
parent 1d12dc55bd
commit 18659d1cc8
No known key found for this signature in database
GPG Key ID: 1D2C5225471789F9
2 changed files with 12 additions and 6 deletions

View File

@ -1,6 +1,6 @@
{
"name": "sub-store",
"version": "2.19.41",
"version": "2.19.42",
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.",
"main": "src/main.js",
"scripts": {

View File

@ -49,11 +49,17 @@ export default function register($app) {
success(res);
});
// Redirect sub.store to vercel webpage
$app.get('/', async (req, res) => {
// 302 redirect
res.set('location', 'https://sub-store.vercel.app/').status(302).end();
});
if (ENV().isNode) {
$app.get('/', getEnv);
} else {
// Redirect sub.store to vercel webpage
$app.get('/', async (req, res) => {
// 302 redirect
res.set('location', 'https://sub-store.vercel.app/')
.status(302)
.end();
});
}
// handle preflight request for QX
if (ENV().isQX) {