mirror of
https://github.com/NeteaseCloudMusicApiEnhanced/api-enhanced.git
synced 2026-06-27 21:25:08 +00:00
fix(deploy): 修复部分启动失败 (#196)
This commit is contained in:
parent
6550c7c827
commit
395a80e74b
9
app.js
9
app.js
@ -8,11 +8,16 @@ 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_token
|
// 启动时更新anonymous_token(Vercel 构建环境下跳过网络请求喵~)
|
||||||
|
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()
|
start().catch((err) => {
|
||||||
|
console.error('[FATAL] 启动失败:', err)
|
||||||
|
process.exit(1)
|
||||||
|
})
|
||||||
|
|||||||
@ -54,7 +54,7 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://neteasecloudmusicapienhanced.js.org/",
|
"homepage": "https://neteasecloudmusicapienhanced.js.org/",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=12"
|
"node": ">=22"
|
||||||
},
|
},
|
||||||
"lint-staged": {
|
"lint-staged": {
|
||||||
"*.js": [
|
"*.js": [
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user