Revert "fix(deploy): 修复部分启动失败 (#196)"

This reverts commit 395a80e74b9e69b8bfadfc19d77d57121f68087d.
This commit is contained in:
ElyPrism 2026-06-18 22:50:53 +08:00
parent 2c9da8507d
commit dc6f56e8a8
No known key found for this signature in database
3 changed files with 6 additions and 10 deletions

13
app.js
View File

@ -8,16 +8,11 @@ async function start() {
if (!fs.existsSync(path.resolve(tmpPath, 'anonymous_token'))) { if (!fs.existsSync(path.resolve(tmpPath, 'anonymous_token'))) {
fs.writeFileSync(path.resolve(tmpPath, 'anonymous_token'), '', 'utf-8') fs.writeFileSync(path.resolve(tmpPath, 'anonymous_token'), '', 'utf-8')
} }
// 启动时更新anonymous_tokenVercel 构建环境下跳过网络请求喵~ // 启动时更新anonymous_token
if (!process.env.VERCEL_ENV) { const generateConfig = require('./generateConfig')
const generateConfig = require('./generateConfig') await generateConfig()
await generateConfig()
}
require('./server').serveNcmApi({ require('./server').serveNcmApi({
checkVersion: true, checkVersion: true,
}) })
} }
start().catch((err) => { start()
console.error('[FATAL] 启动失败:', err)
process.exit(1)
})

1
index.mjs Normal file
View File

@ -0,0 +1 @@
import './app.js'

View File

@ -54,7 +54,7 @@
}, },
"homepage": "https://neteasecloudmusicapienhanced.js.org/", "homepage": "https://neteasecloudmusicapienhanced.js.org/",
"engines": { "engines": {
"node": ">=22" "node": ">=12"
}, },
"lint-staged": { "lint-staged": {
"*.js": [ "*.js": [