mirror of
https://github.com/NeteaseCloudMusicApiEnhanced/api-enhanced.git
synced 2025-10-22 22:53:09 +00:00
Revert "feat: 尝试支持edgeone"
This reverts commit 99f1639f83c4d7ca845baca3814377d11c77c214.
This commit is contained in:
parent
29ecf0ba11
commit
7ece12c131
23
api/index.js
23
api/index.js
@ -1,23 +0,0 @@
|
|||||||
const { serveNcmApi } = require('../server')
|
|
||||||
|
|
||||||
export default async function handler(req, res) {
|
|
||||||
// EdgeOne Pages 环境配置
|
|
||||||
process.env.NODE_ENV = 'production'
|
|
||||||
|
|
||||||
// 初始化服务
|
|
||||||
const app = await serveNcmApi({
|
|
||||||
port: process.env.PORT || 3000,
|
|
||||||
host: '0.0.0.0'
|
|
||||||
})
|
|
||||||
|
|
||||||
// 将请求转发给 Express 应用
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
app.handle(req, res, (err) => {
|
|
||||||
if (err) {
|
|
||||||
reject(err)
|
|
||||||
} else {
|
|
||||||
resolve()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
@ -1,33 +0,0 @@
|
|||||||
{
|
|
||||||
"functions": {
|
|
||||||
"*": {
|
|
||||||
"memory": 1024,
|
|
||||||
"runtime": "nodejs18"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"routes": [
|
|
||||||
{
|
|
||||||
"src": "/(.*)",
|
|
||||||
"dest": "/api/index.js",
|
|
||||||
"headers": {
|
|
||||||
"Access-Control-Allow-Credentials": "true",
|
|
||||||
"Access-Control-Allow-Methods": "GET,POST,PUT,DELETE,OPTIONS",
|
|
||||||
"Access-Control-Allow-Headers": "X-CSRF-Token, X-Requested-With, Accept, Accept-Version, Content-Length, Content-MD5, Content-Type, Date, X-Api-Version"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"build": {
|
|
||||||
"command": "pnpm install --registry=https://registry.npmmirror.com",
|
|
||||||
"include": [
|
|
||||||
"api",
|
|
||||||
"module",
|
|
||||||
"util",
|
|
||||||
"plugins",
|
|
||||||
"public",
|
|
||||||
"data",
|
|
||||||
"server.js",
|
|
||||||
"package.json",
|
|
||||||
".env"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
14
edgeone.json
Normal file
14
edgeone.json
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"functions": [
|
||||||
|
{
|
||||||
|
"path": "/(.*)",
|
||||||
|
"method": ["GET", "POST", "PUT", "DELETE", "OPTIONS"],
|
||||||
|
"handler": "index.js",
|
||||||
|
"headers": {
|
||||||
|
"Access-Control-Allow-Credentials": "true",
|
||||||
|
"Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, OPTIONS",
|
||||||
|
"Access-Control-Allow-Headers": "X-CSRF-Token, X-Requested-With, Accept, Accept-Version, Content-Length, Content-MD5, Content-Type, Date, X-Api-Version"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user