chore: 尝试适配更多平台的部署

This commit is contained in:
ElyPrism 2025-07-25 17:07:48 +08:00 committed by ImFurina
parent c6bc299bbc
commit 771777b669
3 changed files with 54 additions and 0 deletions

20
_routes.json Normal file
View File

@ -0,0 +1,20 @@
{
"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"
}
}
]
}

14
edgeone.json Normal file
View 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"
}
}
]
}

20
netlify.toml.json Normal file
View File

@ -0,0 +1,20 @@
{
"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
}
]
}