Skip to content

Commit

Permalink
Configure Vercel deployment with adjusted package.json scripts and se…
Browse files Browse the repository at this point in the history
…rver setup
  • Loading branch information
Nagi132 committed Jul 1, 2024
1 parent e3755a6 commit 4896dae
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"build": "react-scripts build --ignore-warnings",
"test": "react-scripts test",
"eject": "react-scripts eject",
"heroku-postbuild": "npm run build"
"vercel-build": "npm run build"
},
"eslintConfig": {
"extends": [
Expand Down
9 changes: 7 additions & 2 deletions server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,20 @@
"name": "server",
"version": "1.0.0",
"description": "",
"main": "index.js",
"main": "server.js",
"scripts": {
"start": "node server.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"cors": "^2.8.5",
"express": "^4.18.2",
"socket.io": "^4.7.2"
"socket.io": "^4.7.2",
"path": "^0.12.7",
"http": "0.0.1-security",
"uuid": "^8.3.2"
}
}
24 changes: 24 additions & 0 deletions vercel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"version": 2,
"builds": [
{
"src": "server/server.js",
"use": "@vercel/node"
},
{
"src": "build/**",
"use": "@vercel/static"
}
],
"routes": [
{
"src": "/api/(.*)",
"dest": "/server/server.js"
},
{
"src": "/(.*)",
"dest": "/build/$1"
}
]
}

0 comments on commit 4896dae

Please sign in to comment.