mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2025-06-04 11:13:59 +08:00
feat: Node.js 环境下 API / 路由不自动跳转到 sub-store.vercel.app
This commit is contained in:
parent
1d12dc55bd
commit
18659d1cc8
@ -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": {
|
||||
|
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user