It still didnt work this was the code for my frontend:
1{2 "version": 2,3 "builds": [4 {5 "src": "package.json",6 "use": "@vercel/static-build",7 "config": {"distDir": "dist"}8 }9 ],10 "rewrites": [11 {"source": "/(.*)", "destination": "/"}12 ]13} and this was the code my backend file {14 "version": 2,15 "name": "backend",16 "builds": [17 {18 "src": "server.js",19 "use": "@vercel/node"20 }21 ],22 "routes": [23 {24 "src": "/(.*)",25 "dest": "server.js"26 }27 ],28 "headers": [29 {30 "source": "/api/(.*)",31 "headers": [32 { "key": "Access-Control-Allow-Credentials", "value": "true" },33 { "key": "Access-Control-Allow-Origin", "value": "*" },34 { "key": "Access-Control-Allow-Methods", "value": "GET,OPTIONS,PATCH,DELETE,POST,PUT" },35 { "key": "Access-Control-Allow-Headers", "value": "X-CSRF-Token, X-Requested-With, Accept, Accept-Version, Content-Length, Content-MD5, Content-Type, Date, X-Api-Version" }36 ]37 }38 ]39}