diff --git a/_routes.json b/_routes.json new file mode 100644 index 0000000..59ec587 --- /dev/null +++ b/_routes.json @@ -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" + } + } + ] +} diff --git a/edgeone.json b/edgeone.json new file mode 100644 index 0000000..38b8826 --- /dev/null +++ b/edgeone.json @@ -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" + } + } + ] +} diff --git a/netlify.toml.json b/netlify.toml.json new file mode 100644 index 0000000..97090f3 --- /dev/null +++ b/netlify.toml.json @@ -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 + } + ] +}