feat: 尝试支持CF Worker部署

This commit is contained in:
ElyPrism 2025-08-05 20:48:33 +08:00 committed by ImFurina
parent a2befaad75
commit 5125847ec4
3 changed files with 9 additions and 40 deletions

View File

@ -1,20 +0,0 @@
{
"version": 2,
"buildCommand": "npm install && npm run build",
"functions": {
"api/index.js": {
"runtime": "nodejs18.x"
}
},
"routes": [
{
"pattern": "/(.*)",
"script": "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"
}
}
]
}

View File

@ -1,20 +0,0 @@
{
"functions": {
"api/index.js": {
"included_files": ["index.js"],
"runtime": "nodejs18.x"
}
},
"redirects": [
{
"source": "/(.*)",
"destination": "/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"
},
"status": 200
}
]
}

9
wrangler.json Normal file
View File

@ -0,0 +1,9 @@
{
"name": "NeteaseCloudMusicApiEnhanced",
"main": "app.js",
"compatibility_date": "2025-08-05",
"compatibility_flags": ["nodejs_compat"],
"service": {
"environment": "production"
}
}